diff options
author | Philip Kelley <phkelley@hotmail.com> | 2013-02-11 09:12:39 -0800 |
---|---|---|
committer | Philip Kelley <phkelley@hotmail.com> | 2013-02-11 09:12:39 -0800 |
commit | e026cfee003e103d79e56983d68a206ae907eada (patch) | |
tree | 16720580285b40a2208d07cd06d1abd893493991 /include/git2/branch.h | |
parent | 8c29dca6c372cae1c6a97d78252ee1d7ac10673b (diff) | |
parent | db4bb4158f1005267e8d0e5785cb75487440580a (diff) | |
download | libgit2-e026cfee003e103d79e56983d68a206ae907eada.tar.gz |
Merge pull request #1323 from jamill/resolve_remote
Resolve a remote branch's remote
Diffstat (limited to 'include/git2/branch.h')
-rw-r--r-- | include/git2/branch.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/git2/branch.h b/include/git2/branch.h index 54a1ab118..3c7fb443c 100644 --- a/include/git2/branch.h +++ b/include/git2/branch.h @@ -210,6 +210,31 @@ GIT_EXTERN(int) git_branch_tracking_name( GIT_EXTERN(int) git_branch_is_head( git_reference *branch); +/** + * Return the name of remote that the remote tracking branch belongs to. + * + * @param remote_name_out The user-allocated buffer which will be + * filled with the name of the remote. Pass NULL if you just want to + * get the needed size of the name of the remote as the output value. + * + * @param buffer_size Size of the `out` buffer in bytes. + * + * @param repo The repository where the branch lives. + * + * @param branch The reference to the remote tracking branch. + * + * @return Number of characters in the reference name + * including the trailing NUL byte; GIT_ENOTFOUND + * when no remote matching remote was gound, + * GIT_EAMBIGUOUS when the branch maps to several remotes, + * otherwise an error code. + */ +GIT_EXTERN(int) git_branch_remote_name( + char *remote_name_out, + size_t buffer_size, + git_repository *repo, + git_reference *branch); + /** @} */ GIT_END_DECL #endif |