Merge branch 'rr/upload-pack-swap-shallow-wanted-ref' into seen
The server-side protocol v2 response order for 'wanted-refs' and 'shallow-info' has been swapped to match the client's expectation, fixing a fetch failure when the server has 'uploadpack.allowRefInWant' enabled and the client performs a shallow fetch. * rr/upload-pack-swap-shallow-wanted-ref: upload-pack: swap wanted-ref/shallow-info responses
commit
868bf023ba
|
|
@ -295,6 +295,24 @@ test_expect_success 'fetching with wildcard that matches multiple refs' '
|
|||
test_grep "want-ref refs/heads/o/bar" log
|
||||
'
|
||||
|
||||
test_expect_success 'shallow clone with ref-in-want' '
|
||||
rm -rf local &&
|
||||
GIT_TEST_PROTOCOL_VERSION=2 git clone --depth=1 "file://$REPO" local &&
|
||||
git -C "$REPO" rev-parse main >expected &&
|
||||
git -C local rev-parse refs/remotes/origin/main >actual &&
|
||||
test_cmp expected actual &&
|
||||
git -C local log --oneline refs/remotes/origin/main >log &&
|
||||
test_line_count = 1 log
|
||||
'
|
||||
|
||||
test_expect_success 'incremental shallow fetch with ref-in-want' '
|
||||
rm -rf local &&
|
||||
GIT_TEST_PROTOCOL_VERSION=2 git clone --depth=1 "file://$REPO" local &&
|
||||
GIT_TEST_PROTOCOL_VERSION=2 git -C local fetch --depth=2 origin main &&
|
||||
git -C local log --oneline refs/remotes/origin/main >log &&
|
||||
test_line_count = 2 log
|
||||
'
|
||||
|
||||
REPO="$(pwd)/repo-ns"
|
||||
|
||||
test_expect_success 'setup namespaced repo' '
|
||||
|
|
|
|||
|
|
@ -1836,8 +1836,8 @@ int upload_pack_v2(struct repository *r, struct packet_reader *request)
|
|||
state = UPLOAD_DONE;
|
||||
break;
|
||||
case UPLOAD_SEND_PACK:
|
||||
send_wanted_ref_info(&data);
|
||||
send_shallow_info(&data);
|
||||
send_wanted_ref_info(&data);
|
||||
|
||||
if (data.uri_protocols.nr) {
|
||||
create_pack_file(&data, &data.uri_protocols);
|
||||
|
|
|
|||
Loading…
Reference in New Issue