remote-hg: test 'shared_path' in a moved clone
[gitweb.git] / t / t7001-mv.sh
index d432f42bcbd509b0dae46848d2745eba26fc6872..b90e985a48efbf8cdb16c6166356f6984ffbcea8 100755 (executable)
@@ -293,6 +293,32 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
        git diff-files --quiet
 '
 
+test_expect_success 'git mv moves a submodule with a .git directory and .gitmodules' '
+       rm -rf mod &&
+       git reset --hard &&
+       git submodule update &&
+       entry="$(git ls-files --stage sub | cut -f 1)" &&
+       (
+               cd sub &&
+               rm -f .git &&
+               cp -a ../.git/modules/sub .git &&
+               GIT_WORK_TREE=. git config --unset core.worktree
+       ) &&
+       mkdir mod &&
+       git mv sub mod/sub &&
+       ! test -e sub &&
+       [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
+       (
+               cd mod/sub &&
+               git status
+       ) &&
+       echo mod/sub >expected &&
+       git config -f .gitmodules submodule.sub.path >actual &&
+       test_cmp expected actual &&
+       git update-index --refresh &&
+       git diff-files --quiet
+'
+
 test_expect_success 'git mv moves a submodule with gitfile' '
        rm -rf mod/sub &&
        git reset --hard &&