diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-22 16:08:05 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-22 16:08:05 -0800 |
commit | 1a545d0b5fa56a7be88fe082cec7847715079a18 (patch) | |
tree | 721ec8d309c6aea0fa3a80eea8d5c1ad07f6bed1 /t | |
parent | 67bc7407211d26de518811dafc2c1cf2e6124709 (diff) | |
parent | 85e2233f982f760d0e731b1258da2580834d8027 (diff) | |
download | git-1a545d0b5fa56a7be88fe082cec7847715079a18.tar.gz git-1a545d0b5fa56a7be88fe082cec7847715079a18.tar.xz |
Merge branch 'il/branch-set-upstream'
* il/branch-set-upstream:
branch: warn and refuse to set a branch as a tracking branch of itself.
Add branch --set-upstream
Diffstat (limited to 't')
-rwxr-xr-x | t/t6040-tracking-info.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh index 664b0f805..1785e178a 100755 --- a/t/t6040-tracking-info.sh +++ b/t/t6040-tracking-info.sh @@ -89,4 +89,25 @@ test_expect_success 'status when tracking annotated tags' ' grep "set up to track" actual && git checkout heavytrack ' + +test_expect_success 'setup tracking with branch --set-upstream on existing branch' ' + git branch from-master master && + test_must_fail git config branch.from-master.merge > actual && + git branch --set-upstream from-master master && + git config branch.from-master.merge > actual && + grep -q "^refs/heads/master$" actual +' + +test_expect_success '--set-upstream does not change branch' ' + git branch from-master2 master && + test_must_fail git config branch.from-master2.merge > actual && + git rev-list from-master2 && + git update-ref refs/heads/from-master2 from-master2^ && + git rev-parse from-master2 >expect2 && + git branch --set-upstream from-master2 master && + git config branch.from-master.merge > actual && + git rev-parse from-master2 >actual2 && + grep -q "^refs/heads/master$" actual && + cmp expect2 actual2 +' test_done |