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>

Heiko Voigt committed Sep 15, 2017 at 13:50 UTC c514167df255f7d67bb08646b95e2afbb15ac787
1 file changed +25
t/t7001-mv.sh
+25
@@ -491,4 +491,29 @@ test_expect_success 'moving a submodule in nested directories' '
491 test_cmp actual expect
492 '
493
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 +
519 test_done