X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7406-submodule-update.sh;h=bf7c788735d6e3e0ecf56e7a2f82826701ee1789;hb=7769a75e96f998b2f1ef51e8a2e88058f56fa519;hp=fa9d23aa31302f53cc1c39473492cf545ca5ae87;hpb=06ff44951a233c2e3dee4f072430ac68306f9bf0;p=git.git diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index fa9d23aa3..bf7c78873 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -74,6 +74,26 @@ test_expect_success 'submodule update detaching the HEAD ' ' ) ' +apos="'"; +test_expect_success 'submodule update does not fetch already present commits' ' + (cd submodule && + echo line3 >> file && + git add file && + test_tick && + git commit -m "upstream line3" + ) && + (cd super/submodule && + head=$(git rev-parse --verify HEAD) && + echo "Submodule path ${apos}submodule$apos: checked out $apos$head$apos" > ../../expected && + git reset --hard HEAD~1 + ) && + (cd super && + git submodule update > ../actual 2> ../actual.err + ) && + test_cmp expected actual && + ! test -s actual.err +' + test_expect_success 'submodule update --rebase staying on master' ' (cd super/submodule && git checkout master