X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft2017-checkout-orphan.sh;h=0e3b8582f2a3edebb0d9eea7fcebaa88f305fd73;hb=145f86a00925b126412387c5ce072ab13cd4df03;hp=be88d4b5ee86b75eb0e5654404064f712192d0a9;hpb=609eb9f7ff2af45d52ea90c0678a442d46aaa163;p=git.git diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh index be88d4b5e..0e3b8582f 100755 --- a/t/t2017-checkout-orphan.sh +++ b/t/t2017-checkout-orphan.sh @@ -14,7 +14,7 @@ TEST_FILE=foo test_expect_success 'Setup' ' echo "Initial" >"$TEST_FILE" && git add "$TEST_FILE" && - git commit -m "First Commit" + git commit -m "First Commit" && test_tick && echo "State 1" >>"$TEST_FILE" && git add "$TEST_FILE" && @@ -68,41 +68,34 @@ test_expect_success '--orphan makes reflog by default' ' git checkout master && git config --unset core.logAllRefUpdates && git checkout --orphan delta && - ! test -f .git/logs/refs/heads/delta && - test_must_fail PAGER= git reflog show delta && + test_must_fail git rev-parse --verify delta@{0} && git commit -m Delta && - test -f .git/logs/refs/heads/delta && - PAGER= git reflog show delta + git rev-parse --verify delta@{0} ' test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' ' git checkout master && git config core.logAllRefUpdates false && git checkout --orphan epsilon && - ! test -f .git/logs/refs/heads/epsilon && - test_must_fail PAGER= git reflog show epsilon && + test_must_fail git rev-parse --verify epsilon@{0} && git commit -m Epsilon && - ! test -f .git/logs/refs/heads/epsilon && - test_must_fail PAGER= git reflog show epsilon + test_must_fail git rev-parse --verify epsilon@{0} ' test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates = false' ' git checkout master && git checkout -l --orphan zeta && - test -f .git/logs/refs/heads/zeta && - test_must_fail PAGER= git reflog show zeta && + test_must_fail git rev-parse --verify zeta@{0} && git commit -m Zeta && - PAGER= git reflog show zeta + git rev-parse --verify zeta@{0} ' test_expect_success 'giving up --orphan not committed when -l and core.logAllRefUpdates = false deletes reflog' ' git checkout master && git checkout -l --orphan eta && - test -f .git/logs/refs/heads/eta && - test_must_fail PAGER= git reflog show eta && + test_must_fail git rev-parse --verify eta@{0} && git checkout master && - ! test -f .git/logs/refs/heads/eta && - test_must_fail PAGER= git reflog show eta + test_must_fail git rev-parse --verify eta@{0} ' test_expect_success '--orphan is rejected with an existing name' '