diff options
author | Vicent Martà <vicent@github.com> | 2013-01-16 14:17:48 -0800 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-01-16 14:17:48 -0800 |
commit | 365485e3c6d3abb780e9f7aff8b7af2d7be7af0b (patch) | |
tree | c80f36d05a13dfafbe9b7fdc0a3dc070322e8ac6 /include/git2/branch.h | |
parent | 230010d19b20764b5f73636c900bd3ff84295100 (diff) | |
parent | bf031581d3d87e44da447f0e5a95bd6a24e5bf34 (diff) | |
download | libgit2-365485e3c6d3abb780e9f7aff8b7af2d7be7af0b.tar.gz |
Merge pull request #1245 from nulltoken/topic/git_branch_tracking_name
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. |