X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7300-clean.sh;h=118c6ebb182b5cd4700e533d6a951b31529149af;hb=a0f4afb;hp=929d5d4d3b9d55f570cef1617a0716b17265c988;hpb=d1c8c0c8c42912eb768a05115c798de50e595f8b;p=git.git diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 929d5d4d3..118c6ebb1 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -380,4 +380,43 @@ test_expect_success 'removal failure' ' ' chmod 755 foo +test_expect_success 'nested git work tree' ' + rm -fr foo bar && + mkdir foo bar && + ( + cd foo && + git init && + >hello.world + git add . && + git commit -a -m nested + ) && + ( + cd bar && + >goodbye.people + ) && + git clean -f -d && + test -f foo/.git/index && + test -f foo/hello.world && + ! test -d bar +' + +test_expect_success 'force removal of nested git work tree' ' + rm -fr foo bar && + mkdir foo bar && + ( + cd foo && + git init && + >hello.world + git add . && + git commit -a -m nested + ) && + ( + cd bar && + >goodbye.people + ) && + git clean -f -f -d && + ! test -d foo && + ! test -d bar +' + test_done