t1503: Fix arithmetic expansion syntax error when using dash
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
Sep 21, 2010 at 18:45 UTC
4098f6717b8137493dddfc1a28a72b25769ed7bc
1 file changed
+2
-2
t/t1503-rev-parse-verify.sh
+2
-2
@@ -106,8 +106,8 @@ test_expect_success 'use --default' '
106
107
test_expect_success 'master@{n} for various n' '
108
N=$(git reflog | wc -l) &&
109
- Nm1=$((N-1)) &&
110
- Np1=$((N+1)) &&
109
+ Nm1=$(($N-1)) &&
110
+ Np1=$(($N+1)) &&
111
git rev-parse --verify master@{0} &&
112
git rev-parse --verify master@{1} &&
113
git rev-parse --verify master@{$Nm1} &&