t/t4202-log.sh: Add testcases
Add testcases for 'git log --diff-filter=[CM]' (copies and renames). Also add a testcase for 'git log --follow'. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
9a01387b97
commit
d930508903
|
@ -16,27 +16,31 @@ test_expect_success setup '
|
||||||
test_tick &&
|
test_tick &&
|
||||||
git commit -m second &&
|
git commit -m second &&
|
||||||
|
|
||||||
|
git mv one ichi &&
|
||||||
|
test_tick &&
|
||||||
|
git commit -m third &&
|
||||||
|
|
||||||
|
cp ichi ein &&
|
||||||
|
git add ein &&
|
||||||
|
test_tick &&
|
||||||
|
git commit -m fourth &&
|
||||||
|
|
||||||
mkdir a &&
|
mkdir a &&
|
||||||
echo ni >a/two &&
|
echo ni >a/two &&
|
||||||
git add a/two &&
|
git add a/two &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
git commit -m third &&
|
git commit -m fifth &&
|
||||||
|
|
||||||
echo san >a/three &&
|
git rm a/two &&
|
||||||
git add a/three &&
|
|
||||||
test_tick &&
|
test_tick &&
|
||||||
git commit -m fourth &&
|
git commit -m sixth
|
||||||
|
|
||||||
git rm a/three &&
|
|
||||||
test_tick &&
|
|
||||||
git commit -m fifth
|
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'diff-filter=A' '
|
test_expect_success 'diff-filter=A' '
|
||||||
|
|
||||||
actual=$(git log --pretty="format:%s" --diff-filter=A HEAD) &&
|
actual=$(git log --pretty="format:%s" --diff-filter=A HEAD) &&
|
||||||
expect=$(echo fourth ; echo third ; echo initial) &&
|
expect=$(echo fifth ; echo fourth ; echo third ; echo initial) &&
|
||||||
test "$actual" = "$expect" || {
|
test "$actual" = "$expect" || {
|
||||||
echo Oops
|
echo Oops
|
||||||
echo "Actual: $actual"
|
echo "Actual: $actual"
|
||||||
|
@ -60,7 +64,43 @@ test_expect_success 'diff-filter=M' '
|
||||||
test_expect_success 'diff-filter=D' '
|
test_expect_success 'diff-filter=D' '
|
||||||
|
|
||||||
actual=$(git log --pretty="format:%s" --diff-filter=D HEAD) &&
|
actual=$(git log --pretty="format:%s" --diff-filter=D HEAD) &&
|
||||||
expect=$(echo fifth) &&
|
expect=$(echo sixth ; echo third) &&
|
||||||
|
test "$actual" = "$expect" || {
|
||||||
|
echo Oops
|
||||||
|
echo "Actual: $actual"
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'diff-filter=R' '
|
||||||
|
|
||||||
|
actual=$(git log -M --pretty="format:%s" --diff-filter=R HEAD) &&
|
||||||
|
expect=$(echo third) &&
|
||||||
|
test "$actual" = "$expect" || {
|
||||||
|
echo Oops
|
||||||
|
echo "Actual: $actual"
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'diff-filter=C' '
|
||||||
|
|
||||||
|
actual=$(git log -C -C --pretty="format:%s" --diff-filter=C HEAD) &&
|
||||||
|
expect=$(echo fourth) &&
|
||||||
|
test "$actual" = "$expect" || {
|
||||||
|
echo Oops
|
||||||
|
echo "Actual: $actual"
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'git log --follow' '
|
||||||
|
|
||||||
|
actual=$(git log --follow --pretty="format:%s" ichi) &&
|
||||||
|
expect=$(echo third ; echo second ; echo initial) &&
|
||||||
test "$actual" = "$expect" || {
|
test "$actual" = "$expect" || {
|
||||||
echo Oops
|
echo Oops
|
||||||
echo "Actual: $actual"
|
echo "Actual: $actual"
|
||||||
|
@ -72,6 +112,7 @@ test_expect_success 'diff-filter=D' '
|
||||||
test_expect_success 'setup case sensitivity tests' '
|
test_expect_success 'setup case sensitivity tests' '
|
||||||
echo case >one &&
|
echo case >one &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
|
git add one
|
||||||
git commit -a -m Second
|
git commit -a -m Second
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue