mirror of
https://github.com/git/git.git
synced 2026-03-22 14:40:09 +01:00
submodule: fixup nested submodules after moving the submodule
connect_work_tree_and_git_dir is used to connect a submodule worktree with its git directory and vice versa after events that require a reconnection such as moving around the working tree. As submodules can have nested submodules themselves, we'd also want to fix the nested submodules when asked to. Add an option to recurse into the nested submodules and connect them as well. As submodules are identified by their name (which determines their git directory in relation to their superproject's git directory) internally and by their path in the working tree of the superproject, we need to make sure that the mapping of name <-> path is kept intact. We can do that in the git-mv command by writing out the gitmodules file first and then forcing a reload of the submodule config machinery. Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
0c89fdd739
commit
da62f786d2
@@ -491,7 +491,7 @@ test_expect_success 'moving a submodule in nested directories' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_failure 'moving nested submodules' '
|
||||
test_expect_success 'moving nested submodules' '
|
||||
git commit -am "cleanup commit" &&
|
||||
mkdir sub_nested_nested &&
|
||||
(cd sub_nested_nested &&
|
||||
|
||||
Reference in New Issue
Block a user