mv: move submodules using a gitfile
[gitweb.git] / t / t7001-mv.sh
index 15c18b6006221d60d90d5749a9274e4061f2ff2f..b99177f689d73e1ee4eba20ba7395271c5899032 100755 (executable)
@@ -293,4 +293,23 @@ 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 gitfile' '
+       rm -rf mod/sub &&
+       git reset --hard &&
+       git submodule update &&
+       entry="$(git ls-files --stage sub | cut -f 1)" &&
+       (
+               cd mod &&
+               git mv ../sub/ .
+       ) &&
+       ! test -e sub &&
+       [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
+       (
+               cd mod/sub &&
+               git status
+       ) &&
+       git update-index --refresh &&
+       git diff-files --quiet
+'
+
 test_done