3 test_description
='git log'
7 test_expect_success setup
'
12 git commit -m initial &&
17 git commit -m second &&
23 git commit -m third &&
28 git commit -m fourth &&
36 test_expect_success
'diff-filter=A' '
38 actual=$(git log --pretty="format:%s" --diff-filter=A HEAD) &&
39 expect=$(echo fourth ; echo third ; echo initial) &&
40 test "$actual" = "$expect" || {
42 echo "Actual: $actual"
48 test_expect_success
'diff-filter=M' '
50 actual=$(git log --pretty="format:%s" --diff-filter=M HEAD) &&
51 expect=$(echo second) &&
52 test "$actual" = "$expect" || {
54 echo "Actual: $actual"
60 test_expect_success
'diff-filter=D' '
62 actual=$(git log --pretty="format:%s" --diff-filter=D HEAD) &&
63 expect=$(echo fifth) &&
64 test "$actual" = "$expect" || {
66 echo "Actual: $actual"
72 test_expect_success
'setup case sensitivity tests' '
75 git commit -a -m Second
78 test_expect_success
'log --grep' '
79 echo second >expect &&
80 git log -1 --pretty="tformat:%s" --grep=sec >actual &&
81 test_cmp expect actual
84 test_expect_success
'log -i --grep' '
85 echo Second >expect &&
86 git log -1 --pretty="tformat:%s" -i --grep=sec >actual &&
87 test_cmp expect actual
90 test_expect_success
'log --grep -i' '
91 echo Second >expect &&
92 git log -1 --pretty="tformat:%s" --grep=sec -i >actual &&
93 test_cmp expect actual