]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t7300-clean.sh
Merge branch 'bc/fortran-userdiff' into maint
[git.git] / t / t7300-clean.sh
index 7d8ed68befed0e85ad85f9f933a2b887125e38e8..6c776e9bec78ab1cf960293d8c796e9de13045b5 100755 (executable)
@@ -388,16 +388,15 @@ test_expect_success 'core.excludesfile' '
 
 '
 
-test_expect_success 'removal failure' '
+test_expect_success SANITY 'removal failure' '
 
        mkdir foo &&
        touch foo/bar &&
        (exec <foo/bar &&
         chmod 0 foo &&
-        test_must_fail git clean -f -d)
-
+        test_must_fail git clean -f -d &&
+        chmod 755 foo)
 '
-chmod 755 foo
 
 test_expect_success 'nested git work tree' '
        rm -fr foo bar &&
@@ -438,4 +437,20 @@ test_expect_success 'force removal of nested git work tree' '
        ! test -d bar
 '
 
+test_expect_success 'git clean -e' '
+       rm -fr repo &&
+       mkdir repo &&
+       (
+               cd repo &&
+               git init &&
+               touch known 1 2 3 &&
+               git add known &&
+               git clean -f -e 1 -e 2 &&
+               test -e 1 &&
+               test -e 2 &&
+               ! (test -e 3) &&
+               test -e known
+       )
+'
+
 test_done