2005-06-22 17:30:47 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
#
|
|
|
|
|
2008-06-28 01:43:09 +08:00
|
|
|
test_description='git apply --stat --summary test, with --recount
|
2005-06-22 17:30:47 +08:00
|
|
|
|
|
|
|
'
|
2021-10-31 06:24:18 +08:00
|
|
|
|
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2005-06-22 17:30:47 +08:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
2008-06-28 01:43:09 +08: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 09:53:53 +08:00
|
|
|
test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
|
2008-06-28 01:43:09 +08: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 09:53:53 +08:00
|
|
|
test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
|
2008-06-28 01:43:09 +08:00
|
|
|
'
|
|
|
|
done <<\EOF
|
|
|
|
rename
|
|
|
|
copy
|
|
|
|
rewrite
|
|
|
|
mode
|
|
|
|
non git (1)
|
|
|
|
non git (2)
|
|
|
|
non git (3)
|
2008-07-05 03:10:14 +08:00
|
|
|
incomplete (1)
|
|
|
|
incomplete (2)
|
2008-06-28 01:43:09 +08:00
|
|
|
EOF
|
2005-06-22 17:30:47 +08:00
|
|
|
|
|
|
|
test_done
|