From: Michał Górny Date: Wed, 25 Jan 2017 13:22:17 +0000 (+0100) Subject: git-r3.eclass: Escape all weird chars in submodule names, #606950 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=eb4c42b20e78f3577ea26a028ff92393e2c4a2ff;p=gentoo.git git-r3.eclass: Escape all weird chars in submodule names, #606950 --- diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass index f76f1a7ea596..d105e50ed144 100644 --- a/eclass/git-r3.eclass +++ b/eclass/git-r3.eclass @@ -447,10 +447,11 @@ _git-r3_set_submodules() { submodule."${subname}".update) [[ ${upd} == none ]] && continue - # https://github.com/git/git/blob/master/refs.c#L39 - # for now, we just filter /. because of #572312 - local enc_subname=${subname//\/.//_} - [[ ${enc_subname} == .* ]] && enc_subname=_${enc_subname#.} + # https://github.com/git/git/blob/master/refs.c#L31 + # we are more restrictive than git itself but that should not + # cause any issues, #572312, #606950 + # TODO: check escaped names for collisions + local enc_subname=${subname//[^a-zA-Z0-9-]/_} submodules+=( "${enc_subname}"