summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-05-08 22:37:41 -0700
committerJunio C Hamano <gitster@pobox.com>2010-05-08 22:37:41 -0700
commitb7511571e3ecd6b81a47e42a52cf9b5160a3d6e9 (patch)
tree56c67e4fdf0f4e30433939d3443543bc9c93851f /t
parentdaa81c4a4a48a76e542293c025972e6a870fec9b (diff)
parent0c3ef984fa2d4a42be787e168cfb189d15b00919 (diff)
downloadgit-b7511571e3ecd6b81a47e42a52cf9b5160a3d6e9.tar.gz
Merge branch 'bg/apply-blank-trailing-context'
* bg/apply-blank-trailing-context: apply: Allow blank *trailing* context lines to match beyond EOF
Diffstat (limited to 't')
-rwxr-xr-xt/t4124-apply-ws-rule.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh
index 8d46df6c3a..d0af697aa1 100755
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -330,6 +330,18 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '
test_cmp one expect
'
+test_expect_success 'missing blank line at end, insert before end, --whitespace=fix' '
+ { echo a; echo; } >one &&
+ git add one &&
+ { echo b; echo a; echo; } >one &&
+ cp one expect &&
+ git diff -- one >patch &&
+ echo a >one &&
+ test_must_fail git apply patch &&
+ git apply --whitespace=fix patch &&
+ test_cmp one expect
+'
+
test_expect_success 'shrink file with tons of missing blanks at end of file' '
{ echo a; echo b; echo c; } >one &&
cp one no-blank-lines &&