Skip to content

Commit 2eee139

Browse files
committed
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
3 parents 4e10cf9 + 8e9182e + cf2ad8e commit 2eee139

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

builtin/fetch-pack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,8 @@ static struct ref *do_fetch_pack(int fd[2],
735735
if (server_supports("no-done")) {
736736
if (args.verbose)
737737
fprintf(stderr, "Server supports no-done\n");
738-
no_done = 1;
738+
if (args.stateless_rpc)
739+
no_done = 1;
739740
}
740741
}
741742
else if (server_supports("multi_ack")) {

upload-pack.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,15 +640,16 @@ static int send_ref(const char *refname, const unsigned char *sha1, int flag, vo
640640
{
641641
static const char *capabilities = "multi_ack thin-pack side-band"
642642
" side-band-64k ofs-delta shallow no-progress"
643-
" include-tag multi_ack_detailed no-done";
643+
" include-tag multi_ack_detailed";
644644
struct object *o = parse_object(sha1);
645645

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

649649
if (capabilities)
650-
packet_write(1, "%s %s%c%s\n", sha1_to_hex(sha1), refname,
651-
0, capabilities);
650+
packet_write(1, "%s %s%c%s%s\n", sha1_to_hex(sha1), refname,
651+
0, capabilities,
652+
stateless_rpc ? " no-done" : "");
652653
else
653654
packet_write(1, "%s %s\n", sha1_to_hex(sha1), refname);
654655
capabilities = NULL;

0 commit comments

Comments
 (0)