X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4104-apply-boundary.sh;h=c617c2a33d8e8ac1dc7e049f9056ca6025fbf852;hb=f7bff60de95951d2c82601350cb3771b347e83ee;hp=e7e2913de745cc9f7639103757933f6238fdd564;hpb=a0d74d160f3d416be8f7fbfd18fee0eebf40d8e0;p=git.git diff --git a/t/t4104-apply-boundary.sh b/t/t4104-apply-boundary.sh index e7e2913de..c617c2a33 100755 --- a/t/t4104-apply-boundary.sh +++ b/t/t4104-apply-boundary.sh @@ -27,6 +27,15 @@ test_expect_success setup ' git diff victim >add-a-patch.with && git diff --unified=0 >add-a-patch.without && + : insert at line two + for i in b a '"$L"' y + do + echo $i + done >victim && + cat victim >insert-a-expect && + git diff victim >insert-a-patch.with && + git diff --unified=0 >insert-a-patch.without && + : modify at the head for i in a '"$L"' y do @@ -55,7 +64,7 @@ test_expect_success setup ' git diff --unified=0 >add-z-patch.without && : modify at the tail - for i in a '"$L"' y + for i in b '"$L"' z do echo $i done >victim && @@ -81,7 +90,7 @@ do with) u= ;; without) u='--unidiff-zero ' ;; esac - for kind in add-a add-z mod-a mod-z del-a del-z + for kind in add-a add-z insert-a mod-a mod-z del-a del-z do test_expect_success "apply $kind-patch $with context" ' cat original >victim && @@ -95,7 +104,7 @@ do done done -for kind in add-a add-z mod-a mod-z del-a del-z +for kind in add-a add-z insert-a mod-a mod-z del-a del-z do rm -f $kind-ng.without sed -e "s/^diff --git /diff /" \ @@ -125,4 +134,13 @@ test_expect_success 'two lines' ' ' +test_expect_success 'apply patch with 3 context lines matching at end' ' + { echo a; echo b; echo c; echo d; } >file && + git add file && + echo e >>file && + git diff >patch && + >file && + test_must_fail git apply patch +' + test_done