]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4100-apply-stat.sh
Merge branch 'ab/detox-gettext-tests'
[thirdparty/git.git] / t / t4100-apply-stat.sh
CommitLineData
fae22ac9
JH
1#!/bin/sh
2#
3# Copyright (c) 2005 Junio C Hamano
4#
5
c14b9d1e 6test_description='git apply --stat --summary test, with --recount
fae22ac9
JH
7
8'
9. ./test-lib.sh
10
c14b9d1e
JS
11UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/'
12
13num=0
14while read title
15do
16 num=$(( $num + 1 ))
17 test_expect_success "$title" '
18 git apply --stat --summary \
19 <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
1108cea7 20 test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
c14b9d1e
JS
21 '
22
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 &&
1108cea7 26 test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
c14b9d1e
JS
27 '
28done <<\EOF
29rename
30copy
31rewrite
32mode
33non git (1)
34non git (2)
35non git (3)
6cf91492
TR
36incomplete (1)
37incomplete (2)
c14b9d1e 38EOF
fae22ac9
JH
39
40test_done