@matheusbsbs / matheus-bagliano / commits / 4793b7e86d
Fork 0

Revert "upload-pack: Implement no-done capability"

This reverts 3e63b21 (upload-pack: Implement no-done capability, 2011-03-14). Together with 761ecf0 (fetch-pack: Implement no-done capability, 2011-03-14) it seems to make the fetch-pack process out of sync and makes it keep talking long after upload-pack stopped listening to it, terminating the process with SIGPIPE.

Junio C Hamano committed Mar 28, 2011 at 23:33 UTC 4793b7e86d007c492a76a5fae379ded97008e7fb
1 file changed +4 -16
upload-pack.c
+4 -16
@@ -27,7 +27,6 @@ static const char upload_pack_usage[] = "git upload-pack [--strict] [--timeout=<
27 static unsigned long oldest_have;
28
29 static int multi_ack, nr_our_refs;
30 -static int no_done;
30 static int use_thin_pack, use_ofs_delta, use_include_tag;
31 static int no_progress, daemon_mode;
32 static int shallow_nr;
@@ -432,7 +431,6 @@ static int get_common_commits(void)
431 char last_hex[41];
432 int got_common = 0;
433 int got_other = 0;
435 - int sent_ready = 0;
434
435 save_commit_buffer = 0;
436
@@ -442,17 +440,10 @@ static int get_common_commits(void)
440
441 if (!len) {
442 if (multi_ack == 2 && got_common
445 - && !got_other && ok_to_give_up()) {
446 - sent_ready = 1;
443 + && !got_other && ok_to_give_up())
444 packet_write(1, "ACK %s ready\n", last_hex);
448 - }
445 if (have_obj.nr == 0 || multi_ack)
446 packet_write(1, "NAK\n");
451 -
452 - if (no_done && sent_ready) {
453 - packet_write(1, "ACK %s\n", last_hex);
454 - return 0;
455 - }
447 if (stateless_rpc)
448 exit(0);
449 got_common = 0;
@@ -466,10 +457,9 @@ static int get_common_commits(void)
457 got_other = 1;
458 if (multi_ack && ok_to_give_up()) {
459 const char *hex = sha1_to_hex(sha1);
469 - if (multi_ack == 2) {
470 - sent_ready = 1;
460 + if (multi_ack == 2)
461 packet_write(1, "ACK %s ready\n", hex);
472 - } else
462 + else
463 packet_write(1, "ACK %s continue\n", hex);
464 }
465 break;
@@ -545,8 +535,6 @@ static void receive_needs(void)
535 multi_ack = 2;
536 else if (strstr(line+45, "multi_ack"))
537 multi_ack = 1;
548 - if (strstr(line+45, "no-done"))
549 - no_done = 1;
538 if (strstr(line+45, "thin-pack"))
539 use_thin_pack = 1;
540 if (strstr(line+45, "ofs-delta"))
@@ -640,7 +628,7 @@ static int send_ref(const char *refname, const unsigned char *sha1, int flag, vo
628 {
629 static const char *capabilities = "multi_ack thin-pack side-band"
630 " side-band-64k ofs-delta shallow no-progress"
643 - " include-tag multi_ack_detailed no-done";
631 + " include-tag multi_ack_detailed";
632 struct object *o = parse_object(sha1);
633
634 if (!o)