git/list[1] front-page[2] threads[3] people[4] search[5] about
 

t7300 "removal failure" broken on Windows

From
Alex Riesen <raa.lkml@gmail.com>
Date
Feb 26, 2008, 20:22 UTC
Message-ID
<20080226202227.GA1245@steel.home>
Just a heads-up.

The test is fails because it uses "chmod 0" to enforce an error while deleting files by "git clean -f -d". This does not work on windows, because the directories even without write permission on them can be freely modified (the contained names can be removed). Maybe even the removal of list permission does not mean a thing either to cygwin or windows (that last one being more likely the case: it is more wrong).

So git-clean succeeds and the test fails.
It probably can be worked around by opening the file and keeping it open.
The patch below may fix it (haven't tested yet).
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 3840364..85341af 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -320,6 +320,7 @@ test_expect_success 'removal failure' '
 
 	mkdir foo &&
 	touch foo/bar &&
+	exec <foo/bar &&
 	chmod 0 foo &&
 	! git clean -f -d
 
Next: Alex Riesen
Message 1 of 2 in “t7300 "removal failure" broken on Windows”
  1. Alex RiesenFeb 26, 2008
  2. Fix test for cleanup failure in t7300 on WindowsAlex Riesen, Mar 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.