Merge branch 'jk/pack-bitmap-progress'
[gitweb.git] / t / t7001-mv.sh
index 4023b6ec48729d1cd2c9e9809fd322852166d9f0..215d43d6a6c8ce7f2b30e32dce6dfe34adc98b15 100755 (executable)
@@ -443,6 +443,27 @@ test_expect_success 'mv --dry-run does not touch the submodule or .gitmodules' '
        git diff-files --quiet -- sub .gitmodules
 '
 
+test_expect_success 'checking out a commit before submodule moved needs manual updates' '
+       git mv sub sub2 &&
+       git commit -m "moved sub to sub2" &&
+       git checkout -q HEAD^ 2>actual &&
+       echo "warning: unable to rmdir sub2: Directory not empty" >expected &&
+       test_i18ncmp expected actual &&
+       git status -s sub2 >actual &&
+       echo "?? sub2/" >expected &&
+       test_cmp expected actual &&
+       ! test -f sub/.git &&
+       test -f sub2/.git &&
+       git submodule update &&
+       test -f sub/.git &&
+       rm -rf sub2 &&
+       git diff-index --exit-code HEAD &&
+       git update-index --refresh &&
+       git diff-files --quiet -- sub .gitmodules &&
+       git status -s sub2 >actual &&
+       ! test -s actual
+'
+
 test_expect_success 'mv -k does not accidentally destroy submodules' '
        git checkout submodule &&
        mkdir dummy dest &&