summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-05-07 01:32:10 -0700
committerCarlos Martín Nieto <cmn@dwim.me>2013-05-07 01:32:10 -0700
commit1c92f1090ed49d5d15f0ba057067114234e624c4 (patch)
tree578614dbaf839af12e2100f883d1b72eca5551cc /src
parent51e297dd181f74664267b023019add03db0645ba (diff)
parent3d42e9a31e49547e852459cf372984b896d731dd (diff)
downloadlibgit2-1c92f1090ed49d5d15f0ba057067114234e624c4.tar.gz
Merge pull request #1551 from nvloff/set_upstream_local_branch
fix git_branch_set_upstream for local branches
Diffstat (limited to 'src')
-rw-r--r--src/branch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/branch.c b/src/branch.c
index ab661f422..830294941 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -521,7 +521,8 @@ int git_branch_set_upstream(git_reference *branch, const char *upstream_name)
goto on_error;
if (local) {
- if (git_buf_puts(&value, git_reference_name(branch)) < 0)
+ git_buf_clear(&value);
+ if (git_buf_puts(&value, git_reference_name(upstream)) < 0)
goto on_error;
} else {
/* Get the remoe-tracking branch's refname in its repo */