aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-01 16:22:39 -0700
committerJunio C Hamano <gitster@pobox.com>2008-07-01 16:22:39 -0700
commit27158e463a1be339ce34c7ee5fb553acaa7e28de (patch)
treea4ba9d0f81716dcb30e69677e09ef79c0878441d /t
parentd4b76e15ea733002e364298a81889452b8bb2dfd (diff)
parentc14b9d1e330a7f68ffd0ad7e22d6148c6097c122 (diff)
downloadgit-27158e463a1be339ce34c7ee5fb553acaa7e28de.tar.gz
git-27158e463a1be339ce34c7ee5fb553acaa7e28de.tar.xz
Merge branch 'js/apply-recount'
* js/apply-recount: Allow git-apply to recount the lines in a hunk (AKA recountdiff)
Diffstat (limited to 't')
-rwxr-xr-xt/t4100-apply-stat.sh62
1 files changed, 27 insertions, 35 deletions
diff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh
index 8073a5a1f..be837bb98 100755
--- a/t/t4100-apply-stat.sh
+++ b/t/t4100-apply-stat.sh
@@ -3,44 +3,36 @@
# Copyright (c) 2005 Junio C Hamano
#
-test_description='git apply --stat --summary test.
+test_description='git apply --stat --summary test, with --recount
'
. ./test-lib.sh
-test_expect_success \
- 'rename' \
- 'git apply --stat --summary <../t4100/t-apply-1.patch >current &&
- test_cmp ../t4100/t-apply-1.expect current'
-
-test_expect_success \
- 'copy' \
- 'git apply --stat --summary <../t4100/t-apply-2.patch >current &&
- test_cmp ../t4100/t-apply-2.expect current'
-
-test_expect_success \
- 'rewrite' \
- 'git apply --stat --summary <../t4100/t-apply-3.patch >current &&
- test_cmp ../t4100/t-apply-3.expect current'
-
-test_expect_success \
- 'mode' \
- 'git apply --stat --summary <../t4100/t-apply-4.patch >current &&
- test_cmp ../t4100/t-apply-4.expect current'
-
-test_expect_success \
- 'non git' \
- 'git apply --stat --summary <../t4100/t-apply-5.patch >current &&
- test_cmp ../t4100/t-apply-5.expect current'
-
-test_expect_success \
- 'non git' \
- 'git apply --stat --summary <../t4100/t-apply-6.patch >current &&
- test_cmp ../t4100/t-apply-6.expect current'
-
-test_expect_success \
- 'non git' \
- 'git apply --stat --summary <../t4100/t-apply-7.patch >current &&
- test_cmp ../t4100/t-apply-7.expect current'
+UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/'
+
+num=0
+while read title
+do
+ num=$(( $num + 1 ))
+ test_expect_success "$title" '
+ git apply --stat --summary \
+ <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
+ test_cmp ../t4100/t-apply-$num.expect current
+ '
+
+ test_expect_success "$title with recount" '
+ sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
+ git apply --recount --stat --summary >current &&
+ test_cmp ../t4100/t-apply-$num.expect current
+ '
+done <<\EOF
+rename
+copy
+rewrite
+mode
+non git (1)
+non git (2)
+non git (3)
+EOF
test_done