3 test_description='Revision traversal vs grafts and path limiter'
7 test_expect_success setup '
10 echo >subdir/fileB fileB &&
11 git add fileA subdir/fileB &&
12 git commit -a -m "Initial in one history." &&
13 A0=`git rev-parse --verify HEAD` &&
15 echo >fileA fileA modified &&
16 git commit -a -m "Second in one history." &&
17 A1=`git rev-parse --verify HEAD` &&
19 echo >subdir/fileB fileB modified &&
20 git commit -a -m "Third in one history." &&
21 A2=`git rev-parse --verify HEAD` &&
23 rm -f .git/refs/heads/master .git/index &&
25 echo >fileA fileA again &&
26 echo >subdir/fileB fileB again &&
27 git add fileA subdir/fileB &&
28 git commit -a -m "Initial in alternate history." &&
29 B0=`git rev-parse --verify HEAD` &&
31 echo >fileA fileA modified in alternate history &&
32 git commit -a -m "Second in alternate history." &&
33 B1=`git rev-parse --verify HEAD` &&
35 echo >subdir/fileB fileB modified in alternate history &&
36 git commit -a -m "Third in alternate history." &&
37 B2=`git rev-parse --verify HEAD` &&
56 if test "$which" = arg
61 if test "$type" = basic
65 if test "z$child" != z
72 if test "$type" != basic && test "z$child" != z
74 echo >>test.expect $child
78 git rev-list $arg >test.actual
79 elif test $type = parents
81 git rev-list --parents $arg >test.actual
82 elif test $type = parents-raw
84 git rev-list --parents --pretty=raw $arg |
85 sed -n -e 's/^commit //p' >test.actual
87 diff test.expect test.actual
90 for type in basic parents parents-raw
92 test_expect_success 'without grafts' "
93 rm -f .git/info/grafts
94 check $type $B2 -- $B2 $B1 $B0
97 test_expect_success 'with grafts' "
98 echo '$B0 $A2' >.git/info/grafts
99 check $type $B2 -- $B2 $B1 $B0 $A2 $A1 $A0
102 test_expect_success 'without grafts, with pathlimit' "
103 rm -f .git/info/grafts
104 check $type $B2 subdir -- $B2 $B0
107 test_expect_success 'with grafts, with pathlimit' "
108 echo '$B0 $A2' >.git/info/grafts
109 check $type $B2 subdir -- $B2 $B0 $A2 $A0