Start the 2.46 cycle
[git.git] / t / t4100-apply-stat.sh
blobd503547732c54d8f952027580dc21a6b65729cdb
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git apply --stat --summary test, with --recount
10 TEST_PASSES_SANITIZE_LEAK=true
11 . ./test-lib.sh
13 UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/'
15 num=0
16 while read title
18 num=$(( $num + 1 ))
19 test_expect_success "$title" '
20 git apply --stat --summary \
21 <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
22 test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
25 test_expect_success "$title with recount" '
26 sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
27 git apply --recount --stat --summary >current &&
28 test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
30 done <<\EOF
31 rename
32 copy
33 rewrite
34 mode
35 non git (1)
36 non git (2)
37 non git (3)
38 incomplete (1)
39 incomplete (2)
40 EOF
42 test_done