diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-01-25 14:22:17 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-01-25 14:24:04 +0100 |
commit | eb4c42b20e78f3577ea26a028ff92393e2c4a2ff (patch) | |
tree | 17599d90a10c9c8262a93940f5f494bdd6608524 /eclass/git-r3.eclass | |
parent | profiles: Remove FreeBSD 10.2. (diff) | |
download | gentoo-eb4c42b20e78f3577ea26a028ff92393e2c4a2ff.tar.gz gentoo-eb4c42b20e78f3577ea26a028ff92393e2c4a2ff.tar.bz2 gentoo-eb4c42b20e78f3577ea26a028ff92393e2c4a2ff.zip |
git-r3.eclass: Escape all weird chars in submodule names, #606950
Diffstat (limited to 'eclass/git-r3.eclass')
-rw-r--r-- | eclass/git-r3.eclass | 9 |
1 files changed, 5 insertions, 4 deletions
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}" |