diff options
author | Ilari Liusvaara <ilari.liusvaara@elisanet.fi> | 2010-01-18 22:44:11 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-18 17:09:32 -0800 |
commit | 4fc500667636c4ada592a40c4d11ce0560c43c0d (patch) | |
tree | 78c07862f09c2b89339a53a287a4f5540dc73a4c /t/t6040-tracking-info.sh | |
parent | ff6d26a0e1d8fad775010fa3b689c0c027da8bb0 (diff) | |
download | git-4fc500667636c4ada592a40c4d11ce0560c43c0d.tar.gz |
Add branch --set-upstream
Add --set-upstream option to branch that works like --track, except that
when branch exists already, its upstream info is changed without changing
the ref value.
Based-on-patch-from: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6040-tracking-info.sh')
-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 664b0f8052..1785e178a4 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 |