Merge branch 'mg/branch-set-upstream-previous' into maint

* mg/branch-set-upstream-previous:
  branch.c: use the parsed branch name
This commit is contained in:
Junio C Hamano
2011-09-23 14:16:22 -07:00
2 changed files with 15 additions and 1 deletions

View File

@ -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