diff options
author | Vicent Martà <vicent@github.com> | 2013-04-11 06:34:59 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-04-11 06:34:59 -0700 |
commit | ea8bac37b0c3a302b8f740cbeb4af50d0626815b (patch) | |
tree | a6d3eb230c55f683d4c65921552a132bcc2c7a37 /include/git2/branch.h | |
parent | acd4077182b508f5c88353ddfcf31e14614d0d46 (diff) | |
parent | d59942c2aba2fa5f9570b37e3bc9eaf34f16d671 (diff) | |
download | libgit2-ea8bac37b0c3a302b8f740cbeb4af50d0626815b.tar.gz |
Merge pull request #1450 from carlosmn/branch-upstream
Branch upstream configuration
Diffstat (limited to 'include/git2/branch.h')
-rw-r--r-- | include/git2/branch.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/git2/branch.h b/include/git2/branch.h index 89a1396af..b15171360 100644 --- a/include/git2/branch.h +++ b/include/git2/branch.h @@ -171,11 +171,23 @@ GIT_EXTERN(int) git_branch_name(const char **out, * @return 0 on success; GIT_ENOTFOUND when no remote tracking * reference exists, otherwise an error code. */ -GIT_EXTERN(int) git_branch_tracking( +GIT_EXTERN(int) git_branch_upstream( git_reference **out, git_reference *branch); /** + * Set the upstream configuration for a given local branch + * + * @param branch the branch to configure + * + * @param upstream_name remote-tracking or local branch to set as + * upstream. Pass NULL to unset. + * + * @return 0 or an error code + */ +GIT_EXTERN(int) git_branch_set_upstream(git_reference *branch, const char *upstream_name); + +/** * Return the name of the reference supporting the remote tracking branch, * given the name of a local branch reference. * @@ -193,7 +205,7 @@ GIT_EXTERN(int) git_branch_tracking( * including the trailing NUL byte; GIT_ENOTFOUND when no remote tracking * reference exists, otherwise an error code. */ -GIT_EXTERN(int) git_branch_tracking_name( +GIT_EXTERN(int) git_branch_upstream_name( char *tracking_branch_name_out, size_t buffer_size, git_repository *repo, |