3 test_description='fetch/clone from a shallow clone over http'
7 if test -n "$NO_CURL"; then
8 skip_all='skipping test, git built without http support'
12 . "$TEST_DIRECTORY"/lib-httpd.sh
21 test_expect_success 'setup shallow clone' '
29 git clone --no-local --depth=5 .git shallow &&
30 git config --global transfer.fsckObjects true
33 test_expect_success 'clone http repository' '
34 git clone --bare --no-local shallow "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
35 git clone $HTTPD_URL/smart/repo.git clone &&
39 git log --format=%s origin/master >actual &&
47 test_cmp expect actual
51 # This test is tricky. We need large enough "have"s that fetch-pack
52 # will put pkt-flush in between. Then we need a "have" the server
53 # does not have, it'll send "ACK %s ready"
54 test_expect_success 'no shallow lines after receiving ACK ready' '
58 for i in $(test_seq 15)
60 git checkout --orphan unrelated$i &&
61 test_commit unrelated$i &&
62 git push -q "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \
63 refs/heads/unrelated$i:refs/heads/unrelated$i &&
64 git push -q ../clone/.git \
65 refs/heads/unrelated$i:refs/heads/unrelated$i ||
68 git checkout master &&
70 git push "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" master
74 git checkout --orphan newnew &&
75 test_commit new-too &&
76 GIT_TRACE_PACKET="$TRASH_DIRECTORY/trace" git fetch --depth=2 &&
77 grep "fetch-pack< ACK .* ready" ../trace &&
78 ! grep "fetch-pack> done" ../trace