3 test_description
='test quickfetch from local'
7 test_expect_success setup
'
12 git commit -m initial &&
15 git count-objects | sed -e "s/ *objects,.*//"
20 test_expect_success
'clone without alternate' '
26 git remote add -f origin ..
30 git count-objects | sed -e "s/ *objects,.*//"
35 test_expect_success
'further commits in the original' '
39 git commit -a -m second &&
42 git count-objects | sed -e "s/ *objects,.*//"
47 test_expect_success
'copy commit and tree but not blob by hand' '
49 git rev-list --objects HEAD |
50 git pack-objects --stdout |
58 git count-objects | sed -e "s/ *objects,.*//"
62 blob=$(git rev-parse HEAD:file | sed -e "s|..|&/|") &&
63 test -f "cloned/.git/objects/$blob" &&
64 rm -f "cloned/.git/objects/$blob" &&
68 git count-objects | sed -e "s/ *objects,.*//"
74 test_expect_success
'quickfetch should not leave a corrupted repository' '
83 git count-objects | sed -e "s/ *objects,.*//"
89 test_expect_success
'quickfetch should not copy from alternate' '
95 (cd ../.git/objects && pwd) >.git/objects/info/alternates &&
96 git remote add origin .. &&
101 git count-objects | sed -e "s/ *objects,.*//"
105 git count-objects -v | sed -n -e "/packs:/{
113 git rev-parse origin/master
115 echo "loose objects: $obj_cnt, packfiles: $pck_cnt" &&
116 test $obj_cnt -eq 0 &&
117 test $pck_cnt -eq 0 &&
118 test z$origin_master = z$(git rev-parse master)