@@ -16,27 +16,31 @@ test_expect_success setup '
16
16
test_tick &&
17
17
git commit -m second &&
18
18
19
- mkdir a &&
20
- echo ni >a/two &&
21
- git add a/two &&
19
+ git mv one ichi &&
22
20
test_tick &&
23
21
git commit -m third &&
24
22
25
- echo san >a/three &&
26
- git add a/three &&
23
+ cp ichi ein &&
24
+ git add ein &&
27
25
test_tick &&
28
26
git commit -m fourth &&
29
27
30
- git rm a/three &&
28
+ mkdir a &&
29
+ echo ni >a/two &&
30
+ git add a/two &&
31
+ test_tick &&
32
+ git commit -m fifth &&
33
+
34
+ git rm a/two &&
31
35
test_tick &&
32
- git commit -m fifth
36
+ git commit -m sixth
33
37
34
38
'
35
39
36
40
test_expect_success ' diff-filter=A' '
37
41
38
42
actual=$(git log --pretty="format:%s" --diff-filter=A HEAD) &&
39
- expect=$(echo fourth ; echo third ; echo initial) &&
43
+ expect=$(echo fifth ; echo fourth ; echo third ; echo initial) &&
40
44
test "$actual" = "$expect" || {
41
45
echo Oops
42
46
echo "Actual: $actual"
@@ -60,7 +64,43 @@ test_expect_success 'diff-filter=M' '
60
64
test_expect_success ' diff-filter=D' '
61
65
62
66
actual=$(git log --pretty="format:%s" --diff-filter=D HEAD) &&
63
- expect=$(echo fifth) &&
67
+ expect=$(echo sixth ; echo third) &&
68
+ test "$actual" = "$expect" || {
69
+ echo Oops
70
+ echo "Actual: $actual"
71
+ false
72
+ }
73
+
74
+ '
75
+
76
+ test_expect_success ' diff-filter=R' '
77
+
78
+ actual=$(git log -M --pretty="format:%s" --diff-filter=R HEAD) &&
79
+ expect=$(echo third) &&
80
+ test "$actual" = "$expect" || {
81
+ echo Oops
82
+ echo "Actual: $actual"
83
+ false
84
+ }
85
+
86
+ '
87
+
88
+ test_expect_success ' diff-filter=C' '
89
+
90
+ actual=$(git log -C -C --pretty="format:%s" --diff-filter=C HEAD) &&
91
+ expect=$(echo fourth) &&
92
+ test "$actual" = "$expect" || {
93
+ echo Oops
94
+ echo "Actual: $actual"
95
+ false
96
+ }
97
+
98
+ '
99
+
100
+ test_expect_success ' git log --follow' '
101
+
102
+ actual=$(git log --follow --pretty="format:%s" ichi) &&
103
+ expect=$(echo third ; echo second ; echo initial) &&
64
104
test "$actual" = "$expect" || {
65
105
echo Oops
66
106
echo "Actual: $actual"
@@ -72,6 +112,7 @@ test_expect_success 'diff-filter=D' '
72
112
test_expect_success ' setup case sensitivity tests' '
73
113
echo case >one &&
74
114
test_tick &&
115
+ git add one
75
116
git commit -a -m Second
76
117
'
77
118
0 commit comments