blob: 9b433de83630774206fb89dfae1a4396264390cc [file] [log] [blame]
Junio C Hamanofae22ac2005-06-22 02:30:47 -07001#!/bin/sh
2#
3# Copyright (c) 2005 Junio C Hamano
4#
5
Johannes Schindelinc14b9d12008-06-27 18:43:09 +01006test_description='git apply --stat --summary test, with --recount
Junio C Hamanofae22ac2005-06-22 02:30:47 -07007
8'
9. ./test-lib.sh
10
Johannes Schindelinc14b9d12008-06-27 18:43:09 +010011UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/'
Junio C Hamanofae22ac2005-06-22 02:30:47 -070012
Johannes Schindelinc14b9d12008-06-27 18:43:09 +010013num=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 &&
Junio C Hamanobfdbee92008-08-08 02:26:28 -070020 test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
Johannes Schindelinc14b9d12008-06-27 18:43:09 +010021 '
Junio C Hamanofae22ac2005-06-22 02:30:47 -070022
Johannes Schindelinc14b9d12008-06-27 18:43:09 +010023 test_expect_success "$title with recount" '
24 sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
25 git apply --recount --stat --summary >current &&
Junio C Hamanobfdbee92008-08-08 02:26:28 -070026 test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
Johannes Schindelinc14b9d12008-06-27 18:43:09 +010027 '
28done <<\EOF
29rename
30copy
31rewrite
32mode
33non git (1)
34non git (2)
35non git (3)
Thomas Rast6cf91492008-07-04 21:10:14 +020036incomplete (1)
37incomplete (2)
Johannes Schindelinc14b9d12008-06-27 18:43:09 +010038EOF
Junio C Hamanofae22ac2005-06-22 02:30:47 -070039
40test_done