]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-submodule.sh: separate parens by a space to avoid confusing some shells
authorBrandon Casey <drafnel@gmail.com>
Thu, 26 May 2011 20:52:04 +0000 (13:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2011 22:04:05 +0000 (15:04 -0700)
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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh

index b010a673097a9cfcf009b307114669b6221d066c..4361ae418cfc032f793d14af057e2b178922ca1f 100755 (executable)
@@ -491,7 +491,7 @@ cmd_update()
                                # Run fetch only if $sha1 isn't present or it
                                # is not reachable from a ref.
                                (clear_local_git_env; cd "$path" &&
-                                       ((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
+                                       ( (rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
                                         test -z "$rev") || git-fetch)) ||
                                die "Unable to fetch in submodule path '$path'"
                        fi