t7300: fix clean up on Windows
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 11 Mar 2009 16:58:32 +0000 (17:58 +0100)
committerJohannes Sixt <j6t@kdbg.org>
Thu, 19 Mar 2009 20:47:14 +0000 (21:47 +0100)
On Windows, you cannot remove files that are in use, not even with
'rm -rf'.  So we need to run 'exec <foo/bar' inside a subshell lest
removing the whole test repository fail.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
t/t7300-clean.sh

index 1636fac2a43e30a99674df98ff4544ee04612cc5..929d5d4d3b9d55f570cef1617a0716b17265c988 100755 (executable)
@@ -373,9 +373,9 @@ test_expect_success 'removal failure' '
 
        mkdir foo &&
        touch foo/bar &&
-       exec <foo/bar &&
-       chmod 0 foo &&
-       test_must_fail git clean -f -d
+       (exec <foo/bar &&
+        chmod 0 foo &&
+        test_must_fail git clean -f -d)
 
 '
 chmod 755 foo