From c68f8375760dc6b77f9c68772230a9c6cfd52aa7 Mon Sep 17 00:00:00 2001 From: Heiko Voigt Date: Mon, 16 Oct 2017 15:58:27 +0200 Subject: implement fetching of moved submodules We store the changed submodules paths to calculate which submodule needs fetching. This does not work for moved submodules since their paths do not stay the same in case of a moved submodules. In case of new submodules we do not have a path in the current checkout, since they just appeared in this fetch. It is more general to collect the submodule names for changes instead of their paths to include the above cases. If we do not have a configuration for a gitlink we rely on constructing a default name from the path if a git repository can be found at its path. We skip non-configured gitlinks whose default name collides with a configured one. With the change described above we implement 'on-demand' fetching of changes in moved submodules. Signed-off-by: Heiko Voigt Signed-off-by: Junio C Hamano --- submodule-config.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'submodule-config.h') diff --git a/submodule-config.h b/submodule-config.h index e3845831f6..a5503a5d17 100644 --- a/submodule-config.h +++ b/submodule-config.h @@ -22,6 +22,9 @@ struct submodule { int recommend_shallow; }; +#define SUBMODULE_INIT { NULL, NULL, NULL, RECURSE_SUBMODULES_NONE, \ + NULL, NULL, SUBMODULE_UPDATE_STRATEGY_INIT, {0}, -1 }; + struct submodule_cache; struct repository; -- cgit v1.2.3