mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'jx/remote-archive-over-smart-http'
"git archive --remote=<remote>" learned to talk over the smart http (aka stateless) transport. * jx/remote-archive-over-smart-http: transport-helper: call do_take_over() in process_connect transport-helper: call do_take_over() in connect_helper http-backend: new rpc-service for git-upload-archive transport-helper: protocol v2 supports upload-archive remote-curl: supports git-upload-archive service transport-helper: no connection restriction in connect_helper
This commit is contained in:
@@ -1446,8 +1446,14 @@ static int stateless_connect(const char *service_name)
|
||||
* establish a stateless connection, otherwise we need to tell the
|
||||
* client to fallback to using other transport helper functions to
|
||||
* complete their request.
|
||||
*
|
||||
* The "git-upload-archive" service is a read-only operation. Fallback
|
||||
* to use "git-upload-pack" service to discover protocol version.
|
||||
*/
|
||||
discover = discover_refs(service_name, 0);
|
||||
if (!strcmp(service_name, "git-upload-archive"))
|
||||
discover = discover_refs("git-upload-pack", 0);
|
||||
else
|
||||
discover = discover_refs(service_name, 0);
|
||||
if (discover->version != protocol_v2) {
|
||||
printf("fallback\n");
|
||||
fflush(stdout);
|
||||
@@ -1485,9 +1491,11 @@ static int stateless_connect(const char *service_name)
|
||||
|
||||
/*
|
||||
* Dump the capability listing that we got from the server earlier
|
||||
* during the info/refs request.
|
||||
* during the info/refs request. This does not work with the
|
||||
* "git-upload-archive" service.
|
||||
*/
|
||||
write_or_die(rpc.in, discover->buf, discover->len);
|
||||
if (strcmp(service_name, "git-upload-archive"))
|
||||
write_or_die(rpc.in, discover->buf, discover->len);
|
||||
|
||||
/* Until we see EOF keep sending POSTs */
|
||||
while (1) {
|
||||
|
||||
Reference in New Issue
Block a user