git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t3700: fix broken test under !POSIXPERM
@ 2017-08-07 19:53 René Scharfe
  2017-08-08 19:21 ` [PATCH v2] " René Scharfe
  0 siblings, 1 reply; 4+ messages in thread
From: René Scharfe @ 2017-08-07 19:53 UTC (permalink / raw)
  To: Git List, Junio C Hamano; +Cc: Edward Thomson, Thomas Gummerer

76e368c378 (t3700: fix broken test under !SANITY) explains that the test
'git add --chmod=[+-]x changes index with already added file' can fail
if xfoo3 is still present as a symlink from a previous test and deletes
it with rm(1).  That still leaves it present in the index, which causes
the test to fail if POSIXPERM is not defined.  Get rid of it by calling
"git reset --hard" instead, as 76e368c378 already mentioned in passing.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 t/t3700-add.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index f3a4b4a913..4111fa3b7a 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -355,7 +355,7 @@ test_expect_success POSIXPERM,SYMLINKS 'git add --chmod=+x with symlinks' '
 '
 
 test_expect_success 'git add --chmod=[+-]x changes index with already added file' '
-	rm -f foo3 xfoo3 &&
+	git reset --hard &&
 	echo foo >foo3 &&
 	git add foo3 &&
 	git add --chmod=+x foo3 &&
-- 
2.14.0

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

* [PATCH v2] t3700: fix broken test under !POSIXPERM
  2017-08-07 19:53 [PATCH] t3700: fix broken test under !POSIXPERM René Scharfe
@ 2017-08-08 19:21 ` René Scharfe
  2017-08-08 19:32   ` Ramsay Jones
  0 siblings, 1 reply; 4+ messages in thread
From: René Scharfe @ 2017-08-08 19:21 UTC (permalink / raw)
  To: Git List, Junio C Hamano; +Cc: Edward Thomson, Thomas Gummerer, Adam Dinwoodie

76e368c378 (t3700: fix broken test under !SANITY) explains that the test
'git add --chmod=[+-]x changes index with already added file' can fail
if xfoo3 is still present as a symlink from a previous test and deletes
it with rm(1).  That still leaves it present in the index, which causes
the test to fail if POSIXPERM is not defined.  Get rid of it by calling
"git reset --hard" as well, as 76e368c378 already mentioned in passing.

Helped-by: Adam Dinwoodie <adam@dinwoodie.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
Change since v1: Keep the rm(1) call to avoid a problem on Cygwin.

 t/t3700-add.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index f3a4b4a913..0aae21d698 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -356,6 +356,7 @@ test_expect_success POSIXPERM,SYMLINKS 'git add --chmod=+x with symlinks' '
 
 test_expect_success 'git add --chmod=[+-]x changes index with already added file' '
 	rm -f foo3 xfoo3 &&
+	git reset --hard &&
 	echo foo >foo3 &&
 	git add foo3 &&
 	git add --chmod=+x foo3 &&
-- 
2.14.0

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

* Re: [PATCH v2] t3700: fix broken test under !POSIXPERM
  2017-08-08 19:21 ` [PATCH v2] " René Scharfe
@ 2017-08-08 19:32   ` Ramsay Jones
  2017-08-08 19:39     ` Ramsay Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Ramsay Jones @ 2017-08-08 19:32 UTC (permalink / raw)
  To: René Scharfe, Git List, Junio C Hamano
  Cc: Edward Thomson, Thomas Gummerer, Adam Dinwoodie



On 08/08/17 20:21, René Scharfe wrote:
> 76e368c378 (t3700: fix broken test under !SANITY) explains that the test
> 'git add --chmod=[+-]x changes index with already added file' can fail
> if xfoo3 is still present as a symlink from a previous test and deletes
> it with rm(1).  That still leaves it present in the index, which causes
> the test to fail if POSIXPERM is not defined.  Get rid of it by calling
> "git reset --hard" as well, as 76e368c378 already mentioned in passing.

Hmm, I don't think its POSIXPERM (which is defined on cygwin) but
the lack of SANITY that is the problem. The test would fail on Linux
as well, if it skipped the prior tests marked with SANITY (they get
rid of the xfoo3->xfoo2 symlinks, among others).

Ack, this fixes it for me.

ATB,
Ramsay Jones

> 
> Helped-by: Adam Dinwoodie <adam@dinwoodie.org>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
> Change since v1: Keep the rm(1) call to avoid a problem on Cygwin.
> 
>  t/t3700-add.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/t/t3700-add.sh b/t/t3700-add.sh
> index f3a4b4a913..0aae21d698 100755
> --- a/t/t3700-add.sh
> +++ b/t/t3700-add.sh
> @@ -356,6 +356,7 @@ test_expect_success POSIXPERM,SYMLINKS 'git add --chmod=+x with symlinks' '
>  
>  test_expect_success 'git add --chmod=[+-]x changes index with already added file' '
>  	rm -f foo3 xfoo3 &&
> +	git reset --hard &&
>  	echo foo >foo3 &&
>  	git add foo3 &&
>  	git add --chmod=+x foo3 &&
> 

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

* Re: [PATCH v2] t3700: fix broken test under !POSIXPERM
  2017-08-08 19:32   ` Ramsay Jones
@ 2017-08-08 19:39     ` Ramsay Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Ramsay Jones @ 2017-08-08 19:39 UTC (permalink / raw)
  To: René Scharfe, Git List, Junio C Hamano
  Cc: Edward Thomson, Thomas Gummerer, Adam Dinwoodie



On 08/08/17 20:32, Ramsay Jones wrote:
> 
> 
> On 08/08/17 20:21, René Scharfe wrote:
>> 76e368c378 (t3700: fix broken test under !SANITY) explains that the test
>> 'git add --chmod=[+-]x changes index with already added file' can fail
>> if xfoo3 is still present as a symlink from a previous test and deletes
>> it with rm(1).  That still leaves it present in the index, which causes
>> the test to fail if POSIXPERM is not defined.  Get rid of it by calling
>> "git reset --hard" as well, as 76e368c378 already mentioned in passing.
> 
> Hmm, I don't think its POSIXPERM (which is defined on cygwin) but
> the lack of SANITY that is the problem. The test would fail on Linux
> as well, if it skipped the prior tests marked with SANITY (they get
> rid of the xfoo3->xfoo2 symlinks, among others).

Yep, I didn't read the commit message properly! ;-)

> 
> Ack, this fixes it for me.
> 
> ATB,
> Ramsay Jones
> 
>>
>> Helped-by: Adam Dinwoodie <adam@dinwoodie.org>
>> Signed-off-by: Rene Scharfe <l.s.r@web.de>
>> ---
>> Change since v1: Keep the rm(1) call to avoid a problem on Cygwin.
>>
>>  t/t3700-add.sh | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/t/t3700-add.sh b/t/t3700-add.sh
>> index f3a4b4a913..0aae21d698 100755
>> --- a/t/t3700-add.sh
>> +++ b/t/t3700-add.sh
>> @@ -356,6 +356,7 @@ test_expect_success POSIXPERM,SYMLINKS 'git add --chmod=+x with symlinks' '
>>  
>>  test_expect_success 'git add --chmod=[+-]x changes index with already added file' '
>>  	rm -f foo3 xfoo3 &&
>> +	git reset --hard &&
>>  	echo foo >foo3 &&
>>  	git add foo3 &&
>>  	git add --chmod=+x foo3 &&
>>
> 

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

end of thread, other threads:[~2017-08-08 19:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 19:53 [PATCH] t3700: fix broken test under !POSIXPERM René Scharfe
2017-08-08 19:21 ` [PATCH v2] " René Scharfe
2017-08-08 19:32   ` Ramsay Jones
2017-08-08 19:39     ` Ramsay Jones

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).