@@ -17,11 +17,15 @@ test_expect_success \
17
17
' echo frotz >file0 &&
18
18
mkdir path1 &&
19
19
echo rezrov >path1/file1 &&
20
+ before0=$(git hash-object file0) &&
21
+ before1=$(git hash-object path1/file1) &&
20
22
git update-index --add file0 path1/file1 &&
21
23
tree=$(git write-tree) &&
22
24
echo "$tree" &&
23
25
echo nitfol >file0 &&
24
26
echo yomin >path1/file1 &&
27
+ after0=$(git hash-object file0) &&
28
+ after1=$(git hash-object path1/file1) &&
25
29
git update-index file0 path1/file1'
26
30
27
31
cat > expected << \EOF
@@ -31,32 +35,32 @@ test_expect_success \
31
35
' git diff-index --cached $tree -- path >current &&
32
36
compare_diff_raw current expected'
33
37
34
- cat > expected << \ EOF
35
- :100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M path1/file1
38
+ cat > expected << EOF
39
+ :100644 100644 $before1 $after1 M path1/file1
36
40
EOF
37
41
test_expect_success \
38
42
' limit to path1 should show path1/file1' \
39
43
' git diff-index --cached $tree -- path1 >current &&
40
44
compare_diff_raw current expected'
41
45
42
- cat > expected << \ EOF
43
- :100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M path1/file1
46
+ cat > expected << EOF
47
+ :100644 100644 $before1 $after1 M path1/file1
44
48
EOF
45
49
test_expect_success \
46
50
' limit to path1/ should show path1/file1' \
47
51
' git diff-index --cached $tree -- path1/ >current &&
48
52
compare_diff_raw current expected'
49
53
50
- cat > expected << \ EOF
51
- :100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M path1/file1
54
+ cat > expected << EOF
55
+ :100644 100644 $before1 $after1 M path1/file1
52
56
EOF
53
57
test_expect_success \
54
58
' "*file1" should show path1/file1' \
55
59
' git diff-index --cached $tree -- "*file1" >current &&
56
60
compare_diff_raw current expected'
57
61
58
- cat > expected << \ EOF
59
- :100644 100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df dca6b92303befc93086aa025d90a5facd7eb2812 M file0
62
+ cat > expected << EOF
63
+ :100644 100644 $before0 $after0 M file0
60
64
EOF
61
65
test_expect_success \
62
66
' limit to file0 should show file0' \
0 commit comments