Git fork
1#!/bin/sh
2
3test_description='reflog walk shows repeated commits again'
4
5. ./test-lib.sh
6
7test_expect_success 'setup commits' '
8 test_commit one file content &&
9 test_commit --append two file content
10'
11
12test_expect_success 'setup reflog with alternating commits' '
13 git checkout -b topic &&
14 git reset one &&
15 git reset two &&
16 git reset one &&
17 git reset two
18'
19
20test_expect_success 'reflog shows all entries' '
21 cat >expect <<-\EOF &&
22 topic@{0} reset: moving to two
23 topic@{1} reset: moving to one
24 topic@{2} reset: moving to two
25 topic@{3} reset: moving to one
26 topic@{4} branch: Created from HEAD
27 EOF
28 git log -g --format="%gd %gs" topic >actual &&
29 test_cmp expect actual
30'
31
32test_done