diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-01-14 14:22:11 +0100 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-01-16 22:56:13 +0100 |
commit | bf031581d3d87e44da447f0e5a95bd6a24e5bf34 (patch) | |
tree | c80f36d05a13dfafbe9b7fdc0a3dc070322e8ac6 /include/git2/branch.h | |
parent | 28cbd2e2a891af604c78efd04624215f38185c8a (diff) | |
download | libgit2-bf031581d3d87e44da447f0e5a95bd6a24e5bf34.tar.gz |
branch: Introduce git_branch_tracking_name()
Diffstat (limited to 'include/git2/branch.h')
-rw-r--r-- | include/git2/branch.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/git2/branch.h b/include/git2/branch.h index 3bda43170..70d609ebe 100644 --- a/include/git2/branch.h +++ b/include/git2/branch.h @@ -158,6 +158,30 @@ GIT_EXTERN(int) git_branch_tracking( git_reference *branch); /** + * Return the name of the reference supporting the remote tracking branch, + * given the name of a local branch reference. + * + * @param tracking_branch_name_out The user-allocated buffer which will be + * filled with the name of the reference. Pass NULL if you just want to + * get the needed size of the name of the reference as the output value. + * + * @param buffer_size Size of the `out` buffer in bytes. + * + * @param repo the repository where the branches live + * + * @param canonical_branch_name name of the local branch. + * + * @return number of characters in the reference name + * including the trailing NUL byte; GIT_ENOTFOUND when no remote tracking + * reference exists, otherwise an error code. + */ +GIT_EXTERN(int) git_branch_tracking_name( + char *tracking_branch_name_out, + size_t buffer_size, + git_repository *repo, + const char *canonical_branch_name); + +/** * Determine if the current local branch is pointed at by HEAD. * * @param branch Current underlying reference of the branch. |