X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4128-apply-root.sh;h=6cc741a634b0352c54fe8e5f61f1e99543909b8c;hb=a9e11220c2656cc5d7baac4d0735c04f9be46438;hp=8f6aea48d84621ae3b7304636452c724a4bbe5b6;hpb=a1eb73d917e15cd97314e0a39cbe857329339a96;p=git.git diff --git a/t/t4128-apply-root.sh b/t/t4128-apply-root.sh index 8f6aea48d..6cc741a63 100755 --- a/t/t4128-apply-root.sh +++ b/t/t4128-apply-root.sh @@ -57,6 +57,23 @@ test_expect_success 'apply --directory (new file)' ' test content = $(cat some/sub/dir/newfile) ' +cat > patch << EOF +diff --git a/c/newfile2 b/c/newfile2 +new file mode 100644 +index 0000000..d95f3ad +--- /dev/null ++++ b/c/newfile2 +@@ -0,0 +1 @@ ++content +EOF + +test_expect_success 'apply --directory -p (new file)' ' + git reset --hard initial && + git apply -p2 --directory=some/sub/dir/ --index patch && + test content = $(git show :some/sub/dir/newfile2) && + test content = $(cat some/sub/dir/newfile2) +' + cat > patch << EOF diff --git a/delfile b/delfile deleted file mode 100644