@matheusbsbs / matheus-bagliano / commits / 0c7a97fafd
Fork 0

parse-remote::expand_refs_wildcard()

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>

Junio C Hamano committed Dec 18, 2006 at 12:13 UTC 0c7a97fafdaf7911183807019dbbb4d8c5079c4e
1 file changed +3 -5
git-parse-remote.sh
+3 -5
@@ -111,16 +111,14 @@ expand_refs_wildcard () {
111 local_force=
112 test "z$lref" = "z$ref" || local_force='+'
113 echo "$ls_remote_result" |
114 + sed -e '/\^{}$/d' |
115 (
116 IFS=' '
117 while read sha1 name
118 do
119 + # ignore the ones that do not start with $from
120 mapped=${name#"$from"}
119 - if test "z$name" != "z${name%'^{}'}" ||
120 - test "z$name" = "z$mapped"
121 - then
122 - continue
123 - fi
121 + test "z$name" = "z$mapped" && continue
122 echo "${local_force}${name}:${to}${mapped}"
123 done
124 )