Skip to content

Commit c514167

Browse files
hvoigtgitster
authored andcommitted
add test for bug in git-mv for recursive submodules
When using git-mv with a submodule it will detect that and update the paths for its configurations (.gitmodules, worktree and gitfile). This does not work for recursive submodules where a user renames the root submodule. We discovered this fact when working on on-demand fetch for renamed submodules. Lets add a test to document. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 94c9fd2 commit c514167

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

t/t7001-mv.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,4 +491,29 @@ test_expect_success 'moving a submodule in nested directories' '
491491
test_cmp actual expect
492492
'
493493

494+
test_expect_failure 'moving nested submodules' '
495+
git commit -am "cleanup commit" &&
496+
mkdir sub_nested_nested &&
497+
(cd sub_nested_nested &&
498+
touch nested_level2 &&
499+
git init &&
500+
git add . &&
501+
git commit -m "nested level 2"
502+
) &&
503+
mkdir sub_nested &&
504+
(cd sub_nested &&
505+
touch nested_level1 &&
506+
git init &&
507+
git add . &&
508+
git commit -m "nested level 1"
509+
git submodule add ../sub_nested_nested &&
510+
git commit -m "add nested level 2"
511+
) &&
512+
git submodule add ./sub_nested nested_move &&
513+
git commit -m "add nested_move" &&
514+
git submodule update --init --recursive &&
515+
git mv nested_move sub_nested_moved &&
516+
git status
517+
'
518+
494519
test_done

0 commit comments

Comments
 (0)