Browse Source

Merge branches 'sp/maint-fetch-pack-stop-early' and 'sp/maint-upload-pack-stop-early'

* sp/maint-fetch-pack-stop-early:
  enable "no-done" extension only when fetching over smart-http

* sp/maint-upload-pack-stop-early:
  enable "no-done" extension only when serving over smart-http
maint
Junio C Hamano 14 years ago
parent
commit
2eee1393f3
  1. 3
      builtin/fetch-pack.c
  2. 7
      upload-pack.c

3
builtin/fetch-pack.c

@ -735,7 +735,8 @@ static struct ref *do_fetch_pack(int fd[2],
if (server_supports("no-done")) { if (server_supports("no-done")) {
if (args.verbose) if (args.verbose)
fprintf(stderr, "Server supports no-done\n"); fprintf(stderr, "Server supports no-done\n");
no_done = 1; if (args.stateless_rpc)
no_done = 1;
} }
} }
else if (server_supports("multi_ack")) { else if (server_supports("multi_ack")) {

7
upload-pack.c

@ -640,15 +640,16 @@ static int send_ref(const char *refname, const unsigned char *sha1, int flag, vo
{ {
static const char *capabilities = "multi_ack thin-pack side-band" static const char *capabilities = "multi_ack thin-pack side-band"
" side-band-64k ofs-delta shallow no-progress" " side-band-64k ofs-delta shallow no-progress"
" include-tag multi_ack_detailed no-done"; " include-tag multi_ack_detailed";
struct object *o = parse_object(sha1); struct object *o = parse_object(sha1);


if (!o) if (!o)
die("git upload-pack: cannot find object %s:", sha1_to_hex(sha1)); die("git upload-pack: cannot find object %s:", sha1_to_hex(sha1));


if (capabilities) if (capabilities)
packet_write(1, "%s %s%c%s\n", sha1_to_hex(sha1), refname, packet_write(1, "%s %s%c%s%s\n", sha1_to_hex(sha1), refname,
0, capabilities); 0, capabilities,
stateless_rpc ? " no-done" : "");
else else
packet_write(1, "%s %s\n", sha1_to_hex(sha1), refname); packet_write(1, "%s %s\n", sha1_to_hex(sha1), refname);
capabilities = NULL; capabilities = NULL;

Loading…
Cancel
Save