X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/blobdiff_plain/ba5cb156fc92a5dc6160cefa1d65fff46ff1b09f..c18842cc149803ab61f716c84c96bf7d61a5c0fc:/t/t1800-import.sh diff --git a/t/t1800-import.sh b/t/t1800-import.sh index ecaa593..93de794 100755 --- a/t/t1800-import.sh +++ b/t/t1800-import.sh @@ -21,6 +21,33 @@ test_expect_success \ stg delete .. ' +test_expect_success \ + 'Apply a patch created with "git diff" using -p1' \ + ' + stg import -p1 ../t1800-import/git-diff && + [ $(git cat-file -p $(stg id) \ + | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") = 1 ] && + stg delete .. + ' + +test_expect_success \ + 'Apply a patch created with "git diff" using -p0' \ + ' + stg import -p0 ../t1800-import/git-diff-p0 && + [ $(git cat-file -p $(stg id) \ + | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") = 1 ] && + stg delete .. + ' + +test_expect_success \ + 'Apply a patch created with "git diff" using -p2' \ + ' + ! stg import -p2 ../t1800-import/git-diff && + [ $(git cat-file -p $(stg id) \ + | grep -c "tree a5850c97490398571d41d6304dd940800550f507") = 1 ] && + stg delete .. + ' + test_expect_success \ 'Apply a patch created with "git diff" from a subdirectory' \ '