Skip to content

Commit 4098f67

Browse files
Ramsay Jonesgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4af3fab commit 4098f67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t1503-rev-parse-verify.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ test_expect_success 'use --default' '
106106

107107
test_expect_success 'master@{n} for various n' '
108108
N=$(git reflog | wc -l) &&
109-
Nm1=$((N-1)) &&
110-
Np1=$((N+1)) &&
109+
Nm1=$(($N-1)) &&
110+
Np1=$(($N+1)) &&
111111
git rev-parse --verify master@{0} &&
112112
git rev-parse --verify master@{1} &&
113113
git rev-parse --verify master@{$Nm1} &&

0 commit comments

Comments
 (0)