git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/3] t5505: remove unnecessary subshell invocations
@ 2010-03-19 23:36 Brandon Casey
  2010-03-19 23:36 ` [PATCH 2/3] t5505: add missing && Brandon Casey
  2010-03-19 23:36 ` [PATCH 3/3] " Brandon Casey
  0 siblings, 2 replies; 5+ messages in thread
From: Brandon Casey @ 2010-03-19 23:36 UTC (permalink / raw
  To: gitster; +Cc: ilari.liusvaara, git, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>


Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t5505-remote.sh |   43 ++++---------------------------------------
 1 files changed, 4 insertions(+), 39 deletions(-)

diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index a82c5ff..7291230 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -110,16 +110,17 @@ test_expect_success 'remove remote' '
 test_expect_success 'remove remote protects non-remote branches' '
 (
 	cd test &&
-	(cat >expect1 <<EOF
+	{ cat >expect1 <<EOF
 Note: A non-remote branch was not removed; to delete it, use:
   git branch -d master
 EOF
-    cat >expect2 <<EOF
+	} &&
+	{ cat >expect2 <<EOF
 Note: Non-remote branches were not removed; to delete them, use:
   git branch -d foobranch
   git branch -d master
 EOF
-) &&
+	} &&
 	git tag footag
 	git config --add remote.oops.fetch "+refs/*:refs/*" &&
 	git remote rm oops 2>actual1 &&
@@ -534,43 +535,34 @@ test_expect_success 'show empty remote' '
 '
 
 test_expect_success 'new remote' '
-(
 	git remote add someremote foo &&
 	echo foo >expect &&
 	git config --get-all remote.someremote.url >actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url bar' '
-(
 	git remote set-url someremote bar &&
 	echo bar >expect &&
 	git config --get-all remote.someremote.url >actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url baz bar' '
-(
 	git remote set-url someremote baz bar &&
 	echo baz >expect &&
 	git config --get-all remote.someremote.url >actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url zot bar' '
-(
 	test_must_fail git remote set-url someremote zot bar &&
 	echo baz >expect &&
 	git config --get-all remote.someremote.url >actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --push zot baz' '
-(
 	test_must_fail git remote set-url --push someremote zot baz &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
@@ -578,11 +570,9 @@ test_expect_success 'remote set-url --push zot baz' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --push zot' '
-(
 	git remote set-url --push someremote zot &&
 	echo zot >expect &&
 	echo "YYY" >>expect &&
@@ -591,11 +581,9 @@ test_expect_success 'remote set-url --push zot' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --push qux zot' '
-(
 	git remote set-url --push someremote qux zot &&
 	echo qux >expect &&
 	echo "YYY" >>expect &&
@@ -604,11 +592,9 @@ test_expect_success 'remote set-url --push qux zot' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --push foo qu+x' '
-(
 	git remote set-url --push someremote foo qu+x &&
 	echo foo >expect &&
 	echo "YYY" >>expect &&
@@ -617,11 +603,9 @@ test_expect_success 'remote set-url --push foo qu+x' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --push --add aaa' '
-(
 	git remote set-url --push --add someremote aaa &&
 	echo foo >expect &&
 	echo aaa >>expect &&
@@ -631,11 +615,9 @@ test_expect_success 'remote set-url --push --add aaa' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --push bar aaa' '
-(
 	git remote set-url --push someremote bar aaa &&
 	echo foo >expect &&
 	echo bar >>expect &&
@@ -645,11 +627,9 @@ test_expect_success 'remote set-url --push bar aaa' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --push --delete bar' '
-(
 	git remote set-url --push --delete someremote bar &&
 	echo foo >expect &&
 	echo "YYY" >>expect &&
@@ -658,11 +638,9 @@ test_expect_success 'remote set-url --push --delete bar' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --push --delete foo' '
-(
 	git remote set-url --push --delete someremote foo &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
@@ -670,11 +648,9 @@ test_expect_success 'remote set-url --push --delete foo' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --add bbb' '
-(
 	git remote set-url --add someremote bbb &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
@@ -683,11 +659,9 @@ test_expect_success 'remote set-url --add bbb' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --delete .*' '
-(
 	test_must_fail git remote set-url --delete someremote .* &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
@@ -696,11 +670,9 @@ test_expect_success 'remote set-url --delete .*' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --delete bbb' '
-(
 	git remote set-url --delete someremote bbb &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
@@ -708,11 +680,9 @@ test_expect_success 'remote set-url --delete bbb' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --delete baz' '
-(
 	test_must_fail git remote set-url --delete someremote baz &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
@@ -720,11 +690,9 @@ test_expect_success 'remote set-url --delete baz' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --add ccc' '
-(
 	git remote set-url --add someremote ccc &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
@@ -733,11 +701,9 @@ test_expect_success 'remote set-url --add ccc' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_expect_success 'remote set-url --delete baz' '
-(
 	git remote set-url --delete someremote baz &&
 	echo "YYY" >expect &&
 	echo ccc >>expect &&
@@ -745,7 +711,6 @@ test_expect_success 'remote set-url --delete baz' '
 	echo "YYY" >>actual &&
 	git config --get-all remote.someremote.url >>actual &&
 	cmp expect actual
-)
 '
 
 test_done
-- 
1.6.6.2

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

* [PATCH 2/3] t5505: add missing &&
  2010-03-19 23:36 [PATCH 1/3] t5505: remove unnecessary subshell invocations Brandon Casey
@ 2010-03-19 23:36 ` Brandon Casey
  2010-03-20  0:10   ` [PATCH 3/3 resend] t/t5505-remote.sh: escape * to prevent interpretation by shell as glob Brandon Casey
  2010-03-19 23:36 ` [PATCH 3/3] " Brandon Casey
  1 sibling, 1 reply; 5+ messages in thread
From: Brandon Casey @ 2010-03-19 23:36 UTC (permalink / raw
  To: gitster; +Cc: ilari.liusvaara, git, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>


Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t5505-remote.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 7291230..e7afe9e 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -121,7 +121,7 @@ Note: Non-remote branches were not removed; to delete them, use:
   git branch -d master
 EOF
 	} &&
-	git tag footag
+	git tag footag &&
 	git config --add remote.oops.fetch "+refs/*:refs/*" &&
 	git remote rm oops 2>actual1 &&
 	git branch foobranch &&
-- 
1.6.6.2

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

* [PATCH 3/3] t/t5505-remote.sh: escape * to prevent interpretation by shell as glob
  2010-03-19 23:36 [PATCH 1/3] t5505: remove unnecessary subshell invocations Brandon Casey
  2010-03-19 23:36 ` [PATCH 2/3] t5505: add missing && Brandon Casey
@ 2010-03-19 23:36 ` Brandon Casey
  2010-03-20 15:23   ` Junio C Hamano
  1 sibling, 1 reply; 5+ messages in thread
From: Brandon Casey @ 2010-03-19 23:36 UTC (permalink / raw
  To: gitster; +Cc: ilari.liusvaara, git, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>

This test is supposed to check that git-remote correctly refuses to delete
all non-push URLS when the all-encompassing '.*' regular expression is given.
Since the '*' was not protected, it was interpreted by the shell as a file
glob and expanded before being passed to git-remote.  The call to
git-remote still exited non-zero in this case, and the overall test still
passed, but it exited non-zero because git-remote was passed the incorrect
number of arguments, not for the reason it was supposed to fail.

Correct the test by escaping the '*'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t5505-remote.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index e7afe9e..acfea06 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -662,7 +662,7 @@ test_expect_success 'remote set-url --add bbb' '
 '
 
 test_expect_success 'remote set-url --delete .*' '
-	test_must_fail git remote set-url --delete someremote .* &&
+	test_must_fail git remote set-url --delete someremote .\* &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
 	echo bbb >>expect &&
-- 
1.6.6.2

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

* [PATCH 3/3 resend] t/t5505-remote.sh: escape * to prevent interpretation by shell as glob
  2010-03-19 23:36 ` [PATCH 2/3] t5505: add missing && Brandon Casey
@ 2010-03-20  0:10   ` Brandon Casey
  0 siblings, 0 replies; 5+ messages in thread
From: Brandon Casey @ 2010-03-20  0:10 UTC (permalink / raw
  To: gitster; +Cc: ilari.liusvaara, git, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>

This test is supposed to check that git-remote correctly refuses to delete
all URLS for the specified remote which match the '.*' regular expression.
Since the '*' was not protected, it was interpreted by the shell as a file
glob and expanded before being passed to git-remote.  The call to
git-remote still exited non-zero in this case, and the overall test still
passed, but it exited non-zero because git-remote was passed the incorrect
number of arguments, not for the reason it was supposed to fail.

Correct the test by escaping the '*'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---


Well, since I don't know if the origin 3/3 was lost or whether I
accidentally hit 'n' when git-send-email prompted me for whether to send
it, here it is again.

-brandon


 t/t5505-remote.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index e7afe9e..acfea06 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -662,7 +662,7 @@ test_expect_success 'remote set-url --add bbb' '
 '
 
 test_expect_success 'remote set-url --delete .*' '
-	test_must_fail git remote set-url --delete someremote .* &&
+	test_must_fail git remote set-url --delete someremote .\* &&
 	echo "YYY" >expect &&
 	echo baz >>expect &&
 	echo bbb >>expect &&
-- 
1.6.6.2

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

* Re: [PATCH 3/3] t/t5505-remote.sh: escape * to prevent interpretation by shell as glob
  2010-03-19 23:36 ` [PATCH 3/3] " Brandon Casey
@ 2010-03-20 15:23   ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2010-03-20 15:23 UTC (permalink / raw
  To: Brandon Casey; +Cc: ilari.liusvaara, git, Brandon Casey

Thanks.

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

end of thread, other threads:[~2010-03-20 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 23:36 [PATCH 1/3] t5505: remove unnecessary subshell invocations Brandon Casey
2010-03-19 23:36 ` [PATCH 2/3] t5505: add missing && Brandon Casey
2010-03-20  0:10   ` [PATCH 3/3 resend] t/t5505-remote.sh: escape * to prevent interpretation by shell as glob Brandon Casey
2010-03-19 23:36 ` [PATCH 3/3] " Brandon Casey
2010-03-20 15:23   ` Junio C Hamano

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).