]> git.ipfire.org Git - thirdparty/git.git/blob - t/t4100-apply-stat.sh
The third batch
[thirdparty/git.git] / t / t4100-apply-stat.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2005 Junio C Hamano
4 #
5
6 test_description='git apply --stat --summary test, with --recount
7
8 '
9
10 TEST_PASSES_SANITIZE_LEAK=true
11 . ./test-lib.sh
12
13 UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/'
14
15 num=0
16 while read title
17 do
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
23 '
24
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
29 '
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
41
42 test_done