Skip to content

Commit f5799e0

Browse files
drafnelgitster
authored andcommitted
git-submodule.sh: separate parens by a space to avoid confusing some shells
Some shells interpret '(( ))' according to the rules for arithmetic expansion. This may not follow POSIX, but is prevalent in commonly used shells. Bash does not have a problem with this particular instance of '((', likely because it is not followed by a '))', but the public domain ksh does, and so does ksh on IRIX 6.5. So, add a space between the parenthesis to avoid confusing these shells. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 09ffc70 commit f5799e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-submodule.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ cmd_update()
491491
# Run fetch only if $sha1 isn't present or it
492492
# is not reachable from a ref.
493493
(clear_local_git_env; cd "$path" &&
494-
((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
494+
( (rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
495495
test -z "$rev") || git-fetch)) ||
496496
die "Unable to fetch in submodule path '$path'"
497497
fi

0 commit comments

Comments
 (0)