Commit 3f8086e06917a69a81cc2c2f4987f5a5f4451687

Vicent Martí 2013-07-15T09:44:02

Merge pull request #1729 from tiennou/remote-owner 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);