X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7406-submodule-update.sh;h=dcb195b4cf67af3cf5ce94d0f5ca75bf94664b9a;hb=9eefd8ae8a955f470d931c13b8711d98f4e9d56e;hp=5b97222c48a15dff018cb814ca14c59ed0ee91a2;hpb=4d50dbcda574a4618c84c26d0b8b9ef34980a1b7;p=git.git diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index 5b97222c4..dcb195b4c 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -619,4 +619,21 @@ test_expect_success 'submodule add properly re-creates deeper level submodules' ) ' +test_expect_success 'submodule update properly revives a moved submodule' ' + (cd super && + git commit -am "pre move" && + git status >expect&& + H=$(cd submodule2; git rev-parse HEAD) && + git rm --cached submodule2 && + rm -rf submodule2 && + mkdir -p "moved/sub module" && + git update-index --add --cacheinfo 160000 $H "moved/sub module" && + git config -f .gitmodules submodule.submodule2.path "moved/sub module" + git commit -am "post move" && + git submodule update && + git status >actual && + test_cmp expect actual + ) +' + test_done