Skip to content

Commit 3f8086e

Browse files
author
Vicent Martí
committed
Merge pull request libgit2#1729 from tiennou/remote-owner
Add `git_remote_owner`.
2 parents 3517331 + 85e1ede commit 3f8086e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

include/git2/remote.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ GIT_EXTERN(int) git_remote_load(git_remote **out, git_repository *repo, const ch
9595
*/
9696
GIT_EXTERN(int) git_remote_save(const git_remote *remote);
9797

98+
/**
99+
* Get the remote's repository
100+
*
101+
* @param remote the remote
102+
* @return a pointer to the repository
103+
*/
104+
GIT_EXTERN(git_repository *) git_remote_owner(const git_remote *remote);
105+
98106
/**
99107
* Get the remote's name
100108
*

src/remote.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,12 @@ const char *git_remote_name(const git_remote *remote)
467467
return remote->name;
468468
}
469469

470+
git_repository *git_remote_owner(const git_remote *remote)
471+
{
472+
assert(remote);
473+
return remote->repo;
474+
}
475+
470476
const char *git_remote_url(const git_remote *remote)
471477
{
472478
assert(remote);

0 commit comments

Comments
 (0)