X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=t%2Ft7406-submodule-update.sh;h=bf7c788735d6e3e0ecf56e7a2f82826701ee1789;hb=abe27c0cbd97bf6a693004ddb411392ed596a853;hp=fa9d23aa31302f53cc1c39473492cf545ca5ae87;hpb=a35138af75070adb32cf281a56186c9343af36a4;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