* [PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh.
@ 2008-04-10 7:25 Adam Golebiowski
2008-04-10 8:11 ` Jeff King
2008-04-10 8:34 ` Junio C Hamano
0 siblings, 2 replies; 3+ messages in thread
From: Adam Golebiowski @ 2008-04-10 7:25 UTC (permalink / raw)
To: git, gitster
On systems with /bin/sh being different than /bin/bash, make test fails due
to some bash-specific constructs. This patch makes it possible to run the
test-suite systems with on /bin/sh pointing to /bin/ksh.
Signed-off-by: Adam Golebiowski <adamg@pld-linux.org>
---
t/t3200-branch.sh | 2 +-
t/t7201-co.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index cb5f7a4..e8ff82f 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -200,7 +200,7 @@ test_expect_success \
test_expect_success \
'branch from non-branch HEAD w/--track causes failure' \
- '!(git branch --track my10 HEAD^)'
+ '! git branch --track my10 HEAD^'
# Keep this test last, as it changes the current branch
cat >expect <<EOF
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 3111baa..51a9928 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -335,6 +335,6 @@ test_expect_success \
git checkout -b delete-me master &&
rm .git/refs/heads/delete-me &&
test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
- !(git checkout --track -b track)'
+ ! git checkout --track -b track'
test_done
--
1.5.4.5
--
http://www.mysza.eu.org/ | Everybody needs someone sure, someone true,
PLD Linux developer | Everybody needs some solid rock, I know I do.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh.
2008-04-10 7:25 [PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh Adam Golebiowski
@ 2008-04-10 8:11 ` Jeff King
2008-04-10 8:34 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2008-04-10 8:11 UTC (permalink / raw)
To: Adam Golebiowski; +Cc: git, gitster
On Thu, Apr 10, 2008 at 09:25:00AM +0200, Adam Golebiowski wrote:
> - '!(git branch --track my10 HEAD^)'
> + '! git branch --track my10 HEAD^'
These should probably be using the new test_must_fail instead of '!'
anyway.
-Peff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh.
2008-04-10 7:25 [PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh Adam Golebiowski
2008-04-10 8:11 ` Jeff King
@ 2008-04-10 8:34 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2008-04-10 8:34 UTC (permalink / raw)
To: Adam Golebiowski; +Cc: git
Adam Golebiowski <adamg@pld-linux.org> writes:
> On systems with /bin/sh being different than /bin/bash, make test fails due
> to some bash-specific constructs. This patch makes it possible to run the
> test-suite systems with on /bin/sh pointing to /bin/ksh.
>
> Signed-off-by: Adam Golebiowski <adamg@pld-linux.org>
> ---
> t/t3200-branch.sh | 2 +-
> t/t7201-co.sh | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
> index cb5f7a4..e8ff82f 100755
> --- a/t/t3200-branch.sh
> +++ b/t/t3200-branch.sh
> @@ -200,7 +200,7 @@ test_expect_success \
>
> test_expect_success \
> 'branch from non-branch HEAD w/--track causes failure' \
> - '!(git branch --track my10 HEAD^)'
> + '! git branch --track my10 HEAD^'
I do not think you need a subshell for this particular test, so your
change would not be making anything worse, but I do not see a point.
It is a plain vanilla POSIX shell construct; "! ( compound_list )" is not a
bash-ism at all.
http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02_10
> diff --git a/t/t7201-co.sh b/t/t7201-co.sh
> index 3111baa..51a9928 100755
> --- a/t/t7201-co.sh
> +++ b/t/t7201-co.sh
> @@ -335,6 +335,6 @@ test_expect_success \
> git checkout -b delete-me master &&
> rm .git/refs/heads/delete-me &&
> test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
> - !(git checkout --track -b track)'
> + ! git checkout --track -b track'
Same comments apply.
Having said that, as both of these tests are trying to make sure that the
command fails gracefully (iow, say "failure" and refuse, instead of
barfing and dumping core), they could probably use test_must_fail, like
this:
git checkout -b delete-me master &&
rm .git/refs/heads/delete-me &&
test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
- !(git checkout --track -b track)'
+ test_must_fail git checkout --track -b track'
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-10 8:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-10 7:25 [PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh Adam Golebiowski
2008-04-10 8:11 ` Jeff King
2008-04-10 8:34 ` Junio C Hamano
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).