git-r3.eclass: Filter out /. components from submodule refs, #572312
authorMichał Górny <mgorny@gentoo.org>
Fri, 5 Feb 2016 14:35:19 +0000 (15:35 +0100)
committerMichał Górny <mgorny@gentoo.org>
Fri, 5 Feb 2016 14:37:27 +0000 (15:37 +0100)
eclass/git-r3.eclass

index 42d6dbf6b326c2e3800786ce80b511a3d020bdbc..957ff08c296ba50756fdf1637eb2d7bb064e0546 100644 (file)
@@ -362,8 +362,13 @@ _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#.}
+
                submodules+=(
-                       "${subname}"
+                       "${enc_subname}"
                        "$(echo "${data}" | git config -f /dev/fd/0 \
                                submodule."${subname}".url || die)"
                        "$(echo "${data}" | git config -f /dev/fd/0 \