fsck: support demoting errors to warnings
[gitweb.git] / t / t1411-reflog-show.sh
index 9a105fe21f0da2851fc0f2aae4ff10e2417c9842..6f47c0dd0ec9b5e59205ca98eea9bd729605e004 100755 (executable)
@@ -144,4 +144,26 @@ test_expect_success 'empty reflog file' '
        test_cmp expect actual
 '
 
+# This guards against the alternative of showing the diffs vs. the
+# reflog ancestor.  The reflog used is designed to list the commits
+# more than once, so as to exercise the corresponding logic.
+test_expect_success 'git log -g -p shows diffs vs. parents' '
+       test_commit two &&
+       git branch flipflop &&
+       git update-ref refs/heads/flipflop -m flip1 HEAD^ &&
+       git update-ref refs/heads/flipflop -m flop1 HEAD &&
+       git update-ref refs/heads/flipflop -m flip2 HEAD^ &&
+       git log -g -p flipflop >reflog &&
+       grep -v ^Reflog reflog >actual &&
+       git log -1 -p HEAD^ >log.one &&
+       git log -1 -p HEAD >log.two &&
+       (
+               cat log.one; echo
+               cat log.two; echo
+               cat log.one; echo
+               cat log.two
+       ) >expect &&
+       test_cmp expect actual
+'
+
 test_done