Commit 85e1eded6a5302b25c339988a6828aa45fbc23d8

Etienne Samson 2013-07-15T16:31:25

Add `git_remote_owner`

diff --git a/include/git2/remote.h b/include/git2/remote.h
index 45d15d0..13b0436 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -96,6 +96,14 @@ GIT_EXTERN(int) git_remote_load(git_remote **out, git_repository *repo, const ch
 GIT_EXTERN(int) git_remote_save(const git_remote *remote);
 
 /**
+ * Get the remote's repository
+ *
+ * @param remote the remote
+ * @return a pointer to the repository
+ */
+GIT_EXTERN(git_repository *) git_remote_owner(const git_remote *remote);
+
+/**
  * Get the remote's name
  *
  * @param remote the remote
diff --git a/src/remote.c b/src/remote.c
index 0e8354a..158f3e9 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -467,6 +467,12 @@ const char *git_remote_name(const git_remote *remote)
 	return remote->name;
 }
 
+git_repository *git_remote_owner(const git_remote *remote)
+{
+	assert(remote);
+	return remote->repo;
+}
+
 const char *git_remote_url(const git_remote *remote)
 {
 	assert(remote);