diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-06 07:50:19 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-06 07:50:19 +0100 |
commit | 3df27e0e34a634efd0aa842bc49030393deed673 (patch) | |
tree | 2a09d91f6f89cfdb490b1b33133c6692f5db41bd /t/t5702-protocol-v2.sh | |
parent | Merge branch 'sb/submodule-url-to-absolute' (diff) | |
parent | upload-pack: clear flags before each v2 request (diff) | |
download | git-3df27e0e34a634efd0aa842bc49030393deed673.tar.xz git-3df27e0e34a634efd0aa842bc49030393deed673.zip |
Merge branch 'jt/upload-pack-v2-fix-shallow'
"git fetch" over protocol v2 into a shallow repository failed to
fetch full history behind a new tip of history that was diverged
before the cut-off point of the history that was previously fetched
shallowly.
* jt/upload-pack-v2-fix-shallow:
upload-pack: clear flags before each v2 request
upload-pack: make want_obj not global
upload-pack: make have_obj not global
Diffstat (limited to 't/t5702-protocol-v2.sh')
-rwxr-xr-x | t/t5702-protocol-v2.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh index 8360188c01..6ab8dea8cd 100755 --- a/t/t5702-protocol-v2.sh +++ b/t/t5702-protocol-v2.sh @@ -446,6 +446,31 @@ test_expect_success 'fetch supports include-tag and tag following' ' git -C client cat-file -e $(git -C client rev-parse annotated_tag) ' +test_expect_success 'upload-pack respects client shallows' ' + rm -rf server client trace && + + git init server && + test_commit -C server base && + test_commit -C server client_has && + + git clone --depth=1 "file://$(pwd)/server" client && + + # Add extra commits to the client so that the whole fetch takes more + # than 1 request (due to negotiation) + for i in $(test_seq 1 32) + do + test_commit -C client c$i + done && + + git -C server checkout -b newbranch base && + test_commit -C server client_wants && + + GIT_TRACE_PACKET="$(pwd)/trace" git -C client -c protocol.version=2 \ + fetch origin newbranch && + # Ensure that protocol v2 is used + grep "fetch< version 2" trace +' + # Test protocol v2 with 'http://' transport # . "$TEST_DIRECTORY"/lib-httpd.sh |