git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* t7300 "removal failure" broken on Windows
@ 2008-02-26 20:22 Alex Riesen
  2008-03-03 23:48 ` [PATCH] Fix test for cleanup failure in t7300 " Alex Riesen
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Riesen @ 2008-02-26 20:22 UTC (permalink / raw)
  To: git

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
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] Fix test for cleanup failure in t7300 on Windows
  2008-02-26 20:22 t7300 "removal failure" broken on Windows Alex Riesen
@ 2008-03-03 23:48 ` Alex Riesen
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Riesen @ 2008-03-03 23:48 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Keep the file open to: the OS does not allow removal of open files.
The saner systems just have a saner permission model and chmod 0
is enough for the test.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Alex Riesen, Tue, Feb 26, 2008 21:22:27 +0100:
> 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).
> 

It is tested now.

 t/t7300-clean.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 3840364..4037142 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -320,8 +320,9 @@ test_expect_success 'removal failure' '
 
 	mkdir foo &&
 	touch foo/bar &&
+	exec <foo/bar &&
 	chmod 0 foo &&
-	! git clean -f -d
+	test_must_fail git clean -f -d
 
 '
 chmod 755 foo
-- 
1.5.4.3.469.gf84e2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-03 23:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-26 20:22 t7300 "removal failure" broken on Windows Alex Riesen
2008-03-03 23:48 ` [PATCH] Fix test for cleanup failure in t7300 " Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).