3 test_description='fetch/clone from a shallow clone over http'
6 . "$TEST_DIRECTORY"/lib-httpd.sh
15 test_expect_success 'setup shallow clone' '
23 git clone --no-local --depth=5 .git shallow &&
24 git config --global transfer.fsckObjects true
27 test_expect_success 'clone http repository' '
28 git clone --bare --no-local shallow "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
29 git clone $HTTPD_URL/smart/repo.git clone &&
33 git log --format=%s origin/master >actual &&
41 test_cmp expect actual
45 # This test is tricky. We need large enough "have"s that fetch-pack
46 # will put pkt-flush in between. Then we need a "have" the server
47 # does not have, it'll send "ACK %s ready"
48 test_expect_success 'no shallow lines after receiving ACK ready' '
52 for i in $(test_seq 15)
54 git checkout --orphan unrelated$i &&
55 test_commit unrelated$i &&
56 git push -q "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \
57 refs/heads/unrelated$i:refs/heads/unrelated$i &&
58 git push -q ../clone/.git \
59 refs/heads/unrelated$i:refs/heads/unrelated$i ||
62 git checkout master &&
64 git push "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" master
68 git checkout --orphan newnew &&
69 test_commit new-too &&
70 GIT_TRACE_PACKET="$TRASH_DIRECTORY/trace" git fetch --depth=2 &&
71 grep "fetch-pack< ACK .* ready" ../trace &&
72 ! grep "fetch-pack> done" ../trace