Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-22 22:26:56 +0400
committerJunio C Hamano <gitster@pobox.com>2013-04-22 22:26:56 +0400
commit21247455f328fcf26fc4f78134bcc6f8a676fa8a (patch)
treee2ffee5d17870e5cfd69fb0e915a3568c42dfd33 /t
parent2c697a67b14d432b844e996243633711ef5f4b32 (diff)
parent329b26e0b4b2574960ee703eccdb0a7126a60505 (diff)
Merge branch 'jc/apply-ws-fix-tab-in-indent' into maint
* jc/apply-ws-fix-tab-in-indent: test: resurrect q_to_tab apply --whitespace=fix: avoid running over the postimage buffer
Diffstat (limited to 't')
-rwxr-xr-xt/t4124-apply-ws-rule.sh26
-rwxr-xr-xt/t4150-am.sh2
-rw-r--r--t/test-lib-functions.sh4
3 files changed, 31 insertions, 1 deletions
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh
index 581a801649..5d0c598338 100755
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -486,4 +486,30 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol unset' '
test_cmp one expect
'
+test_expect_success 'whitespace=fix to expand' '
+ qz_to_tab_space >preimage <<-\EOF &&
+ QQa
+ QQb
+ QQc
+ ZZZZZZZZZZZZZZZZd
+ QQe
+ QQf
+ QQg
+ EOF
+ qz_to_tab_space >patch <<-\EOF &&
+ diff --git a/preimage b/preimage
+ --- a/preimage
+ +++ b/preimage
+ @@ -1,7 +1,6 @@
+ QQa
+ QQb
+ QQc
+ -QQd
+ QQe
+ QQf
+ QQg
+ EOF
+ git -c core.whitespace=tab-in-indent apply --whitespace=fix patch
+'
+
test_done
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index cdafd7e7c1..12f6b027ac 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -17,7 +17,7 @@ test_expect_success 'setup: messages' '
vero eos et accusam et justo duo dolores et ea rebum.
EOF
- q_to_tab <<-\EOF >>msg &&
+ qz_to_tab_space <<-\EOF >>msg &&
QDuis autem vel eum iriure dolor in hendrerit in vulputate velit
Qesse molestie consequat, vel illum dolore eu feugiat nulla facilisis
Qat vero eros et accumsan et iusto odio dignissim qui blandit
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index fa62d010f6..3fc9cc9288 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -91,6 +91,10 @@ q_to_tab () {
tr Q '\011'
}
+qz_to_tab_space () {
+ tr QZ '\011\040'
+}
+
append_cr () {
sed -e 's/$/Q/' | tr Q '\015'
}