Work around ash "alternate value" expansion bug
Ash (used as /bin/sh on many distros) has a shell expansion bug
for the form ${var:+word word}. The result is a single argument
"word word". Work around by using ${var:+word} ${var:+word} or
equivalent.
Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
77b96d6dbf
commit
ea10b60c91
@ -204,8 +204,15 @@ cmd_add()
|
||||
else
|
||||
|
||||
module_clone "$path" "$realrepo" || exit
|
||||
(unset GIT_DIR; cd "$path" && git checkout -f -q ${branch:+-b "$branch" "origin/$branch"}) ||
|
||||
die "Unable to checkout submodule '$path'"
|
||||
(
|
||||
unset GIT_DIR
|
||||
cd "$path" &&
|
||||
# ash fails to wordsplit ${branch:+-b "$branch"...}
|
||||
case "$branch" in
|
||||
'') git checkout -f -q ;;
|
||||
?*) git checkout -f -q -b "$branch" "origin/$branch" ;;
|
||||
esac
|
||||
) || die "Unable to checkout submodule '$path'"
|
||||
fi
|
||||
|
||||
git add "$path" ||
|
||||
|
||||
Reference in New Issue
Block a user