git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t1503: Fix arithmetic expansion syntax error when using dash
@ 2010-09-21 17:45 Ramsay Jones
  2010-09-22 19:15 ` Re*: " Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Ramsay Jones @ 2010-09-21 17:45 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list, jon.seymour


On systems which have dash as /bin/sh, such as Ubuntu, the final
test (master@{n} for various n) fails with a syntax error while
processing an arithmetic expansion. The syntax error is caused by
using a bare name ('N') as a variable reference in the expression.

In order to avoid the syntax error, we spell the variable reference
as '$N' rather than simply 'N'.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 t/t1503-rev-parse-verify.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index 100f857..813cc1b 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -106,8 +106,8 @@ test_expect_success 'use --default' '
 
 test_expect_success 'master@{n} for various n' '
 	N=$(git reflog | wc -l) &&
-	Nm1=$((N-1)) &&
-	Np1=$((N+1)) &&
+	Nm1=$(($N-1)) &&
+	Np1=$(($N+1)) &&
 	git rev-parse --verify master@{0} &&
 	git rev-parse --verify master@{1} &&
 	git rev-parse --verify master@{$Nm1} &&
-- 
1.7.3

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

end of thread, other threads:[~2010-09-30 17:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-21 17:45 [PATCH] t1503: Fix arithmetic expansion syntax error when using dash Ramsay Jones
2010-09-22 19:15 ` Re*: " Junio C Hamano
2010-09-22 21:38   ` Jon Seymour
2010-09-25 17:08   ` Ramsay Jones
2010-09-25 17:24     ` Ævar Arnfjörð Bjarmason
2010-09-29 19:57       ` Ramsay Jones
2010-09-25 17:58     ` 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).