Code

t/: Use "test_must_fail git" instead of "! git"
[git.git] / t / t7300-clean.sh
index afccfc9973ba864167387b1e1caf6fe8b12f68f9..2b51c0d7d8ab727a5fb0be8338938f1d3b2eb6a3 100755 (executable)
@@ -75,8 +75,8 @@ test_expect_success 'git-clean src/ src/' '
 
 test_expect_success 'git-clean with prefix' '
 
-       mkdir -p build docs &&
-       touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
+       mkdir -p build docs src/test &&
+       touch a.out src/part3.c docs/manual.txt obj.o build/lib.so src/test/1.c &&
        (cd src/ && git-clean) &&
        test -f Makefile &&
        test -f README &&
@@ -84,6 +84,7 @@ test_expect_success 'git-clean with prefix' '
        test -f src/part2.c &&
        test -f a.out &&
        test ! -f src/part3.c &&
+       test -f src/test/1.c &&
        test -f docs/manual.txt &&
        test -f obj.o &&
        test -f build/lib.so
@@ -111,7 +112,7 @@ test_expect_success 'git-clean with absolute path' '
        touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
        would_clean=$(
                cd docs &&
-               git clean -n $(pwd)/../src |
+               git clean -n "$(pwd)/../src" |
                sed -n -e "s|^Would remove ||p"
        ) &&
        test "$would_clean" = ../src/part3.c || {
@@ -315,14 +316,14 @@ test_expect_success 'git-clean -d -X' '
 test_expect_success 'clean.requireForce defaults to true' '
 
        git config --unset clean.requireForce &&
-       ! git-clean
+       test_must_fail git clean
 
 '
 
 test_expect_success 'clean.requireForce' '
 
        git config clean.requireForce true &&
-       ! git-clean
+       test_must_fail git clean
 
 '