summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-13 05:49:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-13 05:49:51 (GMT)
commit9f5074e0348071532911cffb622d7df6754a9743 (patch)
treefc7c2003d22ca48107e199175d857c2b32d69801 /t
parent0d181cbb8adbc964a075fd71148415f6bd431272 (diff)
parentffa1eeaeea38f6d667e304f9b12c890b7c14d088 (diff)
downloadgit-9f5074e0348071532911cffb622d7df6754a9743.zip
git-9f5074e0348071532911cffb622d7df6754a9743.tar.gz
git-9f5074e0348071532911cffb622d7df6754a9743.tar.bz2
Merge branch 'jk/maint-reflog-bottom'
* jk/maint-reflog-bottom: reflogs: clear flags properly in corner case
Diffstat (limited to 't')
-rwxr-xr-xt/t1412-reflog-loop.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t1412-reflog-loop.sh b/t/t1412-reflog-loop.sh
new file mode 100755
index 0000000..7f519e5
--- /dev/null
+++ b/t/t1412-reflog-loop.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+test_description='reflog walk shows repeated commits again'
+. ./test-lib.sh
+
+test_expect_success 'setup commits' '
+ test_tick &&
+ echo content >file && git add file && git commit -m one &&
+ git tag one &&
+ echo content >>file && git add file && git commit -m two &&
+ git tag two
+'
+
+test_expect_success 'setup reflog with alternating commits' '
+ git checkout -b topic &&
+ git reset one &&
+ git reset two &&
+ git reset one &&
+ git reset two
+'
+
+test_expect_success 'reflog shows all entries' '
+ cat >expect <<-\EOF
+ topic@{0} two: updating HEAD
+ topic@{1} one: updating HEAD
+ topic@{2} two: updating HEAD
+ topic@{3} one: updating HEAD
+ topic@{4} branch: Created from HEAD
+ EOF
+ git log -g --format="%gd %gs" topic >actual &&
+ test_cmp expect actual
+'
+
+test_done