2005-06-22 11:30:47 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
#
|
|
|
|
|
2008-06-27 19:43:09 +02:00
|
|
|
test_description='git apply --stat --summary test, with --recount
|
2005-06-22 11:30:47 +02:00
|
|
|
|
|
|
|
'
|
2021-10-31 00:24:18 +02:00
|
|
|
|
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2005-06-22 11:30:47 +02:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
2008-06-27 19:43:09 +02:00
|
|
|
UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/'
|
|
|
|
|
|
|
|
num=0
|
|
|
|
while read title
|
|
|
|
do
|
|
|
|
num=$(( $num + 1 ))
|
|
|
|
test_expect_success "$title" '
|
|
|
|
git apply --stat --summary \
|
|
|
|
<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
|
2021-02-11 02:53:53 +01:00
|
|
|
test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
|
2008-06-27 19:43:09 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success "$title with recount" '
|
|
|
|
sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
|
|
|
|
git apply --recount --stat --summary >current &&
|
2021-02-11 02:53:53 +01:00
|
|
|
test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
|
2008-06-27 19:43:09 +02:00
|
|
|
'
|
|
|
|
done <<\EOF
|
|
|
|
rename
|
|
|
|
copy
|
|
|
|
rewrite
|
|
|
|
mode
|
|
|
|
non git (1)
|
|
|
|
non git (2)
|
|
|
|
non git (3)
|
2008-07-04 21:10:14 +02:00
|
|
|
incomplete (1)
|
|
|
|
incomplete (2)
|
2008-06-27 19:43:09 +02:00
|
|
|
EOF
|
2005-06-22 11:30:47 +02:00
|
|
|
|
|
|
|
test_done
|