X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7300-clean.sh;h=dfd118878fd37c096ccd426aa01fa2ac36581367;hb=7fec10b7f41fa32e71aa6377bd04cd7c6fb419e0;hp=23274361877e6d09eec51793cf6c2253541622f8;hpb=03800743156fe4f331a10c0983b9d633bed3a687;p=git.git diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 232743618..dfd118878 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -7,6 +7,8 @@ test_description='git-clean basic tests' . ./test-lib.sh +git config clean.requireForce no + test_expect_success 'setup' ' mkdir -p src && @@ -124,6 +126,20 @@ test_expect_success 'git-clean symbolic link' ' ' +test_expect_success 'git-clean with wildcard' ' + + touch a.clean b.clean other.c && + git-clean "*.clean" && + test -f Makefile && + test -f README && + test -f src/part1.c && + test -f src/part2.c && + test ! -f a.clean && + test ! -f b.clean && + test -f other.c + +' + test_expect_success 'git-clean -n' ' mkdir -p build docs && @@ -244,6 +260,13 @@ test_expect_success 'git-clean -d -X' ' ' +test_expect_success 'clean.requireForce defaults to true' ' + + git config --unset clean.requireForce && + ! git-clean + +' + test_expect_success 'clean.requireForce' ' git config clean.requireForce true && @@ -282,4 +305,15 @@ test_expect_success 'clean.requireForce and -f' ' ' +test_expect_success 'core.excludesfile' ' + + echo excludes >excludes && + echo included >included && + git config core.excludesfile excludes && + output=$(git clean -n excludes included 2>&1) && + expr "$output" : ".*included" >/dev/null && + ! expr "$output" : ".*excludes" >/dev/null + +' + test_done