]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fetch-pack.c
l10n: it.po: update the Italian translation for Git 2.24.0 round #2
[thirdparty/git.git] / fetch-pack.c
index 6ccc6294ea7b7fe2da9d2306acdcf40031a4383f..0130b44112a063f3362f85c808a87f2ee25bf8ac 100644 (file)
@@ -167,16 +167,16 @@ static enum ack_type get_ack(struct packet_reader *reader,
        if (!strcmp(reader->line, "NAK"))
                return NAK;
        if (skip_prefix(reader->line, "ACK ", &arg)) {
-               if (!get_oid_hex(arg, result_oid)) {
-                       arg += 40;
-                       len -= arg - reader->line;
+               const char *p;
+               if (!parse_oid_hex(arg, result_oid, &p)) {
+                       len -= p - reader->line;
                        if (len < 1)
                                return ACK;
-                       if (strstr(arg, "continue"))
+                       if (strstr(p, "continue"))
                                return ACK_continue;
-                       if (strstr(arg, "common"))
+                       if (strstr(p, "common"))
                                return ACK_common;
-                       if (strstr(arg, "ready"))
+                       if (strstr(p, "ready"))
                                return ACK_ready;
                        return ACK;
                }
@@ -382,6 +382,7 @@ static int find_common(struct fetch_negotiator *negotiator,
                state_len = 0;
        }
 
+       trace2_region_enter("fetch-pack", "negotiation_v0_v1", the_repository);
        flushes = 0;
        retval = -1;
        if (args->no_dependents)
@@ -466,6 +467,7 @@ static int find_common(struct fetch_negotiator *negotiator,
                }
        }
 done:
+       trace2_region_leave("fetch-pack", "negotiation_v0_v1", the_repository);
        if (!got_ready || !no_done) {
                packet_buf_write(&req_buf, "done\n");
                send_request(args, fd[1], &req_buf);
@@ -1378,7 +1380,7 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
        enum fetch_state state = FETCH_CHECK_LOCAL;
        struct oidset common = OIDSET_INIT;
        struct packet_reader reader;
-       int in_vain = 0;
+       int in_vain = 0, negotiation_started = 0;
        int haves_to_send = INITIAL_FLUSH;
        struct fetch_negotiator negotiator;
        fetch_negotiator_init(r, &negotiator);
@@ -1421,6 +1423,12 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
                        }
                        break;
                case FETCH_SEND_REQUEST:
+                       if (!negotiation_started) {
+                               negotiation_started = 1;
+                               trace2_region_enter("fetch-pack",
+                                                   "negotiation_v2",
+                                                   the_repository);
+                       }
                        if (send_fetch_request(&negotiator, fd[1], args, ref,
                                               &common,
                                               &haves_to_send, &in_vain,
@@ -1444,6 +1452,9 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
                        }
                        break;
                case FETCH_GET_PACK:
+                       trace2_region_leave("fetch-pack",
+                                           "negotiation_v2",
+                                           the_repository);
                        /* Check for shallow-info section */
                        if (process_section_header(&reader, "shallow-info", 1))
                                receive_shallow_info(args, &reader, shallows, si);