Merge branch 'jk/pack-bitmap-progress'
[gitweb.git] / t / t7001-mv.sh
index e3c8c2c1b8817acd85866470c6f76c4a4f8d17d7..215d43d6a6c8ce7f2b30e32dce6dfe34adc98b15 100755 (executable)
@@ -294,7 +294,8 @@ test_expect_success 'setup submodule' '
        git submodule add ./. sub &&
        echo content >file &&
        git add file &&
-       git commit -m "added sub and file"
+       git commit -m "added sub and file" &&
+       git branch submodule
 '
 
 test_expect_success 'git mv cannot move a submodule in a file' '
@@ -463,4 +464,14 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
        ! test -s actual
 '
 
+test_expect_success 'mv -k does not accidentally destroy submodules' '
+       git checkout submodule &&
+       mkdir dummy dest &&
+       git mv -k dummy sub dest &&
+       git status --porcelain >actual &&
+       grep "^R  sub -> dest/sub" actual &&
+       git reset --hard &&
+       git checkout .
+'
+
 test_done