]> git.ipfire.org Git - thirdparty/git.git/commit
submodule--helper: set alternateLocation for cloned submodules
authorVitaly "_Vi" Shukela <vi0oss@gmail.com>
Thu, 8 Dec 2016 01:38:14 +0000 (04:38 +0300)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Dec 2016 17:56:52 +0000 (09:56 -0800)
commitbf03b790471d57d1bf2a6efca6e0c640c9f37d2e
treeb4cd2ecb4f76f59fcac4e124f489cc986d8b49e2
parent8d7a455ed52e2a96debc080dfc011b6bb00db5d2
submodule--helper: set alternateLocation for cloned submodules

In 31224cbdc7 (clone: recursive and reference option triggers
submodule alternates, 2016-08-17) a mechanism was added to
have submodules referenced.  It did not address _nested_
submodules, however.

This patch makes all not just the root repository, but also
all submodules (recursively) have submodule.alternateLocation
and submodule.alternateErrorStrategy configured, making Git
search for possible alternates for nested submodules as well.

As submodule's alternate target does not end in .git/objects
(rather .git/modules/qqqqqq/objects), this alternate target
path restriction for in add_possible_reference_from_superproject
relates from "*.git/objects" to just */objects".

New tests have been added to t7408-submodule-reference.

Signed-off-by: Vitaly _Vi Shukela <vi0oss@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
t/t7408-submodule-reference.sh