revision.c: make --no-notes reset --notes list
[gitweb.git] / t / t2020-checkout-detach.sh
index bfeb2a65129a7d573a311037c923ae92d6d97f22..569b27fe8d488833c3ec0d9952ae064764a0183f 100755 (executable)
@@ -126,4 +126,17 @@ test_expect_success 'checkout does not warn leaving reachable commit' '
        check_no_orphan_warning stderr
 '
 
+cat >expect <<'EOF'
+Your branch is behind 'master' by 1 commit, and can be fast-forwarded.
+EOF
+test_expect_success 'tracking count is accurate after orphan check' '
+       reset &&
+       git branch child master^ &&
+       git config branch.child.remote . &&
+       git config branch.child.merge refs/heads/master &&
+       git checkout child^ &&
+       git checkout child >stdout &&
+       test_cmp expect stdout
+'
+
 test_done