summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorBrandon Casey <drafnel@gmail.com>2011-05-26 13:52:04 -0700
committerJunio C Hamano <gitster@pobox.com>2011-05-26 15:04:05 -0700
commitf5799e05c0e7fbee32ca32995c7c4a627eeff469 (patch)
tree1945b8153f319ddd74f6f64ebef8d08edbe6cfee /git-submodule.sh
parent09ffc706e48f93ed622a9a61704b2f767666b30d (diff)
downloadgit-f5799e05c0e7fbee32ca32995c7c4a627eeff469.tar.gz
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 <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index b010a67309..4361ae418c 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -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