提交 503359f1 编写于 作者: J Junio C Hamano

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

* mg/branch-set-upstream-previous:
  branch.c: use the parsed branch name
......@@ -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)
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册