diff --git a/t/t1800-import.sh b/t/t1800-import.sh index 8e3fc5cc..bf92ddeb 100755 --- a/t/t1800-import.sh +++ b/t/t1800-import.sh @@ -213,6 +213,21 @@ test_expect_success 'Import empty patch with sign-off' ' stg top | grep -v -e "empty" ' +test_expect_success 'Import with root directory' ' + mkdir -p dir0/dir1/dir2 && + echo "hello" >dir0/dir1/dir2/file.txt && + stg add dir0/dir1/dir2/file.txt && + stg new -rm "dirs" && + echo "bye" >>dir0/dir1/dir2/file.txt && + git diff --relative=dir0/dir1 >relative.diff && + stg reset --hard && + command_error stg import --directory=dir0/dir1/dir2 err && + grep "error: dir0/dir1/dir2/dir2/file.txt: does not exist in index" err && + stg import --name from-relative --3way --directory=dir0/dir1