]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t3200-branch.sh
git --paginate: do not commit pager choice too early
[git.git] / t / t3200-branch.sh
index 8818d0de689327ad9e0922dfd3e784804e142f41..859b99abf1cc62c966322fcfc552c0a7eb7356df 100755 (executable)
@@ -224,6 +224,30 @@ test_expect_success \
         test -f .git/logs/refs/heads/g/h/i &&
         test_cmp 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 &&