Skip to content

Commit

Permalink
parse-remote::expand_refs_wildcard()
Browse files Browse the repository at this point in the history
Work around dash incompatibility by not using "${name%'^{}'}".

Noticed by Jeff King; dash seems to mistake the closing brace
inside the single quote as the terminating brace for parameter
expansion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Dec 18, 2006
1 parent ff7f22f commit 0c7a97f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions git-parse-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,14 @@ expand_refs_wildcard () {
local_force=
test "z$lref" = "z$ref" || local_force='+'
echo "$ls_remote_result" |
sed -e '/\^{}$/d' |
(
IFS=' '
while read sha1 name
do
# ignore the ones that do not start with $from
mapped=${name#"$from"}
if test "z$name" != "z${name%'^{}'}" ||
test "z$name" = "z$mapped"
then
continue
fi
test "z$name" = "z$mapped" && continue
echo "${local_force}${name}:${to}${mapped}"
done
)
Expand Down

0 comments on commit 0c7a97f

Please sign in to comment.