diff options
author | Erick Mattos <erick.mattos@gmail.com> | 2010-05-21 21:28:38 -0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-03 14:46:19 -0700 |
commit | b2099957752071fec70502c81206364ac986073a (patch) | |
tree | 84911a5fa9db3cf47276408310d2e403163b5516 /t/t3200-branch.sh | |
parent | 3631bf77f75bc34e810216f3ec6abc8203e2d16a (diff) | |
download | git-b2099957752071fec70502c81206364ac986073a.tar.gz |
t3200: test -l with core.logAllRefUpdates options
By default reflogs are always created for new local branches by
"checkout -b". But by setting core.logAllRefUpdates to false this will
not be true anymore.
In that case you only create the reflogs when you use -l switch with
"checkout -b".
Added missing tests to check expected behaviors.
Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3200-branch.sh')
-rwxr-xr-x | t/t3200-branch.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index e0b760513c..9d2c06ea69 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -224,6 +224,30 @@ test_expect_success \ test -f .git/logs/refs/heads/g/h/i && diff expect .git/logs/refs/heads/g/h/i' +test_expect_success 'checkout -b makes reflog by default' ' + git checkout master && + git config --unset core.logAllRefUpdates && + git checkout -b alpha && + test -f .git/logs/refs/heads/alpha && + PAGER= git reflog show alpha +' + +test_expect_success 'checkout -b does not make reflog when core.logAllRefUpdates = false' ' + git checkout master && + git config core.logAllRefUpdates false && + git checkout -b beta && + ! test -f .git/logs/refs/heads/beta && + test_must_fail PAGER= git reflog show beta +' + +test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates = false' ' + git checkout master && + git checkout -lb gamma && + git config --unset core.logAllRefUpdates && + test -f .git/logs/refs/heads/gamma && + PAGER= git reflog show gamma +' + test_expect_success 'avoid ambiguous track' ' git config branch.autosetupmerge true && git config remote.ambi1.url lalala && |