diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-08-25 16:00:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-25 16:00:49 -0700 |
commit | b0578c9abe77f2e1c958bf76c620d59be6c2cf65 (patch) | |
tree | 0c32b868df06907137a47de6ca88dc652b65e5cf | |
parent | Merge branch 'da/difftool-mergtool-refactor' (diff) | |
parent | branch.c: use the parsed branch name (diff) | |
download | tgif-b0578c9abe77f2e1c958bf76c620d59be6c2cf65.tar.xz |
Merge branch 'mg/branch-set-upstream-previous'
* mg/branch-set-upstream-previous:
branch.c: use the parsed branch name
-rw-r--r-- | branch.c | 2 | ||||
-rwxr-xr-x | t/t6040-tracking-info.sh | 14 |
2 files changed, 15 insertions, 1 deletions
@@ -210,7 +210,7 @@ void create_branch(const char *head, start_name); if (real_ref && track) - setup_tracking(name, real_ref, track); + setup_tracking(ref.buf+11, real_ref, track); if (!dont_change_ref) if (write_ref_sha1(lock, sha1, msg) < 0) diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh index a9b0ac1efc..19de5b16eb 100755 --- a/t/t6040-tracking-info.sh +++ b/t/t6040-tracking-info.sh @@ -110,4 +110,18 @@ test_expect_success '--set-upstream does not change branch' ' grep -q "^refs/heads/master$" actual && cmp expect2 actual2 ' + +test_expect_success '--set-upstream @{-1}' ' + git checkout from-master && + git checkout from-master2 && + git config branch.from-master2.merge > expect2 && + git branch --set-upstream @{-1} follower && + git config branch.from-master.merge > actual && + git config branch.from-master2.merge > actual2 && + git branch --set-upstream from-master follower && + git config branch.from-master.merge > expect && + test_cmp expect2 actual2 && + test_cmp expect actual +' + test_done |