Jeff King | ffa1eea | 2010-11-21 23:42:53 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='reflog walk shows repeated commits again' |
| 4 | . ./test-lib.sh |
| 5 | |
| 6 | test_expect_success 'setup commits' ' |
| 7 | test_tick && |
| 8 | echo content >file && git add file && git commit -m one && |
| 9 | git tag one && |
| 10 | echo content >>file && git add file && git commit -m two && |
| 11 | git tag two |
| 12 | ' |
| 13 | |
| 14 | test_expect_success 'setup reflog with alternating commits' ' |
| 15 | git checkout -b topic && |
| 16 | git reset one && |
| 17 | git reset two && |
| 18 | git reset one && |
| 19 | git reset two |
| 20 | ' |
| 21 | |
| 22 | test_expect_success 'reflog shows all entries' ' |
Ramkumar Ramachandra | 0238038 | 2011-12-08 18:40:17 +0530 | [diff] [blame] | 23 | cat >expect <<-\EOF && |
Jeff King | d04520e | 2011-07-22 10:12:23 -0600 | [diff] [blame] | 24 | topic@{0} reset: moving to two |
| 25 | topic@{1} reset: moving to one |
| 26 | topic@{2} reset: moving to two |
| 27 | topic@{3} reset: moving to one |
Jeff King | ffa1eea | 2010-11-21 23:42:53 -0500 | [diff] [blame] | 28 | topic@{4} branch: Created from HEAD |
| 29 | EOF |
| 30 | git log -g --format="%gd %gs" topic >actual && |
| 31 | test_cmp expect actual |
| 32 | ' |
| 33 | |
| 34 | test_done |