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-03 20:34:22 +0400
committerJunio C Hamano <gitster@pobox.com>2013-04-03 20:34:22 +0400
commita70f4cb5b06856d5999352930b97fdfc96105954 (patch)
treea41a14a1609753586c3e1027646da0651e7bcda7 /t
parent288e6ff5a64331e5da1dd9d978938b44d50f5be9 (diff)
parent329b26e0b4b2574960ee703eccdb0a7126a60505 (diff)
Merge branch 'jc/apply-ws-fix-tab-in-indent'
"git apply --whitespace=fix" was not prepared to see a line getting longer after fixing whitespaces (e.g. tab-in-indent aka Python). * 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 6f6ee88b28..0bbcf0603d 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 61d0804435..42c2258b4f 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'
}