git-svn: support for git-svn propset
[gitweb.git] / t / t1411-reflog-show.sh
index 7d9b5e33dfc662e97b94116e28062293b8516a9e..6f47c0dd0ec9b5e59205ca98eea9bd729605e004 100755 (executable)
@@ -73,20 +73,20 @@ test_expect_success 'using @{now} syntax shows reflog date (format=%gd)' '
 '
 
 cat >expect <<'EOF'
-Reflog: HEAD@{1112911993 -0700} (C O Mitter <committer@example.com>)
+Reflog: HEAD@{Thu Apr 7 15:13:13 2005 -0700} (C O Mitter <committer@example.com>)
 Reflog message: commit (initial): one
 EOF
 test_expect_success 'using --date= shows reflog date (multiline)' '
-       git log -g -1 --date=raw >tmp &&
+       git log -g -1 --date=default >tmp &&
        grep ^Reflog <tmp >actual &&
        test_cmp expect actual
 '
 
 cat >expect <<'EOF'
-e46513e HEAD@{1112911993 -0700}: commit (initial): one
+e46513e HEAD@{Thu Apr 7 15:13:13 2005 -0700}: commit (initial): one
 EOF
 test_expect_success 'using --date= shows reflog date (oneline)' '
-       git log -g -1 --oneline --date=raw >actual &&
+       git log -g -1 --oneline --date=default >actual &&
        test_cmp expect actual
 '
 
@@ -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