summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-07-15 10:36:14 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-07-15 10:36:14 -0700
commit90360c710c4105e3bce74fc2d746c4fa48bf07e7 (patch)
tree24fd9f59b7c7eab53cb7c0f493272cb598de2724 /t
parentMerge branch 'bc/http-keep-memory-given-to-curl' into maint (diff)
parentapply: carefully strdup a possibly-NULL name (diff)
downloadtgif-90360c710c4105e3bce74fc2d746c4fa48bf07e7.tar.xz
Merge branch 'tr/maint-apply-non-git-patch-parsefix' into maint
"git apply" parsed patches that add new files, generated by programs other than Git, incorrectly. This is an old breakage in v1.7.11. * tr/maint-apply-non-git-patch-parsefix: apply: carefully strdup a possibly-NULL name
Diffstat (limited to 't')
-rwxr-xr-xt/t4111-apply-subdir.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t4111-apply-subdir.sh b/t/t4111-apply-subdir.sh
index 7c398432ba..1618a6dbc7 100755
--- a/t/t4111-apply-subdir.sh
+++ b/t/t4111-apply-subdir.sh
@@ -86,6 +86,20 @@ test_expect_success 'apply --index from subdir of toplevel' '
test_cmp expected sub/dir/file
'
+test_expect_success 'apply half-broken patch from subdir of toplevel' '
+ (
+ cd sub/dir &&
+ test_must_fail git apply <<-EOF
+ --- sub/dir/file
+ +++ sub/dir/file
+ @@ -1,0 +1,0 @@
+ --- file_in_root
+ +++ file_in_root
+ @@ -1,0 +1,0 @@
+ EOF
+ )
+'
+
test_expect_success 'apply from .git dir' '
cp postimage expected &&
cp preimage .git/file &&