Merge branch 'maint'
[git/mingw/4msysgit/kblees.git] / t / t4100-apply-stat.sh
blob9b433de83630774206fb89dfae1a4396264390cc
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git apply --stat --summary test, with --recount
9 . ./test-lib.sh
11 UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/'
13 num=0
14 while read title
16 num=$(( $num + 1 ))
17 test_expect_success "$title" '
18 git apply --stat --summary \
19 <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
20 test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
23 test_expect_success "$title with recount" '
24 sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
25 git apply --recount --stat --summary >current &&
26 test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
28 done <<\EOF
29 rename
30 copy
31 rewrite
32 mode
33 non git (1)
34 non git (2)
35 non git (3)
36 incomplete (1)
37 incomplete (2)
38 EOF
40 test_done