Use reflog in 'pull --rebase . foo'
[gitweb.git] / t / t3200-branch.sh
index 8818d0de689327ad9e0922dfd3e784804e142f41..f54a533456d74a3eb2f745dbc77c8ad5a5ae960f 100755 (executable)
@@ -224,6 +224,27 @@ 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 &&
+       git rev-parse --verify alpha@{0}
+'
+
+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_must_fail git rev-parse --verify beta@{0}
+'
+
+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 &&
+       git rev-parse --verify gamma@{0}
+'
+
 test_expect_success 'avoid ambiguous track' '
        git config branch.autosetupmerge true &&
        git config remote.ambi1.url lalala &&