{"thread":{"id":"10759","subject":"[PATCH 11/11] git-fetch: test avoiding unnecessary copying from alternates","startedAt":"2007-11-09T11:06:50Z","lastAt":"2007-11-09T11:06:50Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":11},"messages":[{"id":"59028","messageId":"20071109110650.GK19368@spearce.org","threadId":"10759","inReplyTo":null,"subject":"[PATCH 11/11] git-fetch: test avoiding unnecessary copying from alternates","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-11-09T11:06:50Z","receivedAt":"2007-11-09T11:06:50Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"This test verifies my prior \"avoid local fetching from alternate\"\npatch is functional and doesn't regress in the future during any\nadditional improvements made to git.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n t/t5502-quickfetch.sh |   33 +++++++++++++++++++++++++++++++++\n 1 files changed, 33 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh\nindex b4760f2..16eadd6 100755\n--- a/t/t5502-quickfetch.sh\n+++ b/t/t5502-quickfetch.sh\n@@ -86,4 +86,37 @@ test_expect_success 'quickfetch should not leave a corrupted repository' '\n \n '\n \n+test_expect_success 'quickfetch should not copy from alternate' '\n+\n+\t(\n+\t\tmkdir quickclone &&\n+\t\tcd quickclone &&\n+\t\tgit init-db &&\n+\t\t(cd ../.git/objects && pwd) >.git/objects/info/alternates &&\n+\t\tgit remote add origin .. &&\n+\t\tgit fetch -k -k\n+\t) &&\n+\tobj_cnt=$( (\n+\t\tcd quickclone &&\n+\t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n+\t) ) &&\n+\tpck_cnt=$( (\n+\t\tcd quickclone &&\n+\t\tgit count-objects -v | sed -n -e \"/packs:/{\n+\t\t\t\ts/packs://\n+\t\t\t\tp\n+\t\t\t\tq\n+\t\t\t}\"\n+\t) ) &&\n+\torigin_master=$( (\n+\t\tcd quickclone &&\n+\t\tgit rev-parse origin/master\n+\t) ) &&\n+\techo \"loose objects: $obj_cnt, packfiles: $pck_cnt\" &&\n+\ttest $obj_cnt -eq 0 &&\n+\ttest $pck_cnt -eq 0 &&\n+\ttest z$origin_master = z$(git rev-parse master)\n+\n+'\n+\n test_done\n-- \n1.5.3.5.1622.g41d10\n"}]}