summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-19 14:05:10 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-19 14:05:10 -0700
commitbb6ac5ea13250b295b4620face2ea5c0c9809b0b (patch)
treed77b828c677f42830807ea42fe0cd4dd191deb4d /t
parent04cd47f553796263451c946061e175d847f388c3 (diff)
parent477a08af04c227064860ce99197c501037f7f39c (diff)
downloadgit-bb6ac5ea13250b295b4620face2ea5c0c9809b0b.tar.gz
Merge branch 'jc/apply-ws-prefix' into maint
* jc/apply-ws-prefix: apply: omit ws check for excluded paths apply: hoist use_patch() helper for path exclusion up apply: use the right attribute for paths in non-Git patches Conflicts: builtin/apply.c
Diffstat (limited to 't')
-rwxr-xr-xt/t4119-apply-config.sh17
-rwxr-xr-xt/t4124-apply-ws-rule.sh11
2 files changed, 28 insertions, 0 deletions
diff --git a/t/t4119-apply-config.sh b/t/t4119-apply-config.sh
index c393be691b..a9a0583811 100755
--- a/t/t4119-apply-config.sh
+++ b/t/t4119-apply-config.sh
@@ -159,4 +159,21 @@ test_expect_success 'same but with traditional patch input of depth 2' '
check_result sub/file1
'
+test_expect_success 'in subdir with traditional patch input' '
+ cd "$D" &&
+ git config apply.whitespace strip &&
+ cat >.gitattributes <<-EOF &&
+ /* whitespace=blank-at-eol
+ sub/* whitespace=-blank-at-eol
+ EOF
+ rm -f sub/file1 &&
+ cp saved sub/file1 &&
+ git update-index --refresh &&
+
+ cd sub &&
+ git apply ../gpatch.file &&
+ echo "B " >expect &&
+ test_cmp expect file1
+'
+
test_done
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh
index 5d0c598338..c6474de4c8 100755
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -512,4 +512,15 @@ test_expect_success 'whitespace=fix to expand' '
git -c core.whitespace=tab-in-indent apply --whitespace=fix patch
'
+test_expect_success 'whitespace check skipped for excluded paths' '
+ git config core.whitespace blank-at-eol &&
+ >used &&
+ >unused &&
+ git add used unused &&
+ echo "used" >used &&
+ echo "unused " >unused &&
+ git diff-files -p used unused >patch &&
+ git apply --include=used --stat --whitespace=error <patch
+'
+
test_done