X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5502-quickfetch.sh;h=16eadd6b68664884836976aafb6dcbb582603c09;hb=8d13caf795902812d44809e2f222fb2334030603;hp=b4760f2dc0bb690429b358cefde911db1fb26e9a;hpb=63f328290a0edda617c0881a356c07280fbba459;p=git.git diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh index b4760f2dc..16eadd6b6 100755 --- a/t/t5502-quickfetch.sh +++ b/t/t5502-quickfetch.sh @@ -86,4 +86,37 @@ test_expect_success 'quickfetch should not leave a corrupted repository' ' ' +test_expect_success 'quickfetch should not copy from alternate' ' + + ( + mkdir quickclone && + cd quickclone && + git init-db && + (cd ../.git/objects && pwd) >.git/objects/info/alternates && + git remote add origin .. && + git fetch -k -k + ) && + obj_cnt=$( ( + cd quickclone && + git count-objects | sed -e "s/ *objects,.*//" + ) ) && + pck_cnt=$( ( + cd quickclone && + git count-objects -v | sed -n -e "/packs:/{ + s/packs:// + p + q + }" + ) ) && + origin_master=$( ( + cd quickclone && + git rev-parse origin/master + ) ) && + echo "loose objects: $obj_cnt, packfiles: $pck_cnt" && + test $obj_cnt -eq 0 && + test $pck_cnt -eq 0 && + test z$origin_master = z$(git rev-parse master) + +' + test_done