]> git.ipfire.org Git - thirdparty/git.git/commitdiff
promisor-remote: output trace2 statistics for number of objects fetched
authorElijah Newren <newren@gmail.com>
Tue, 15 Jun 2021 22:41:42 +0000 (22:41 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Jun 2021 07:17:13 +0000 (16:17 +0900)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
promisor-remote.c

index da3f2ca2615e0896878edf00f36577c85d2dc429..d465377d7d32a1ceb591aedeae3c21f55b781b55 100644 (file)
@@ -12,7 +12,8 @@ void set_repository_format_partial_clone(char *partial_clone)
        repository_format_partial_clone = xstrdup_or_null(partial_clone);
 }
 
-static int fetch_objects(const char *remote_name,
+static int fetch_objects(struct repository *repo,
+                        const char *remote_name,
                         const struct object_id *oids,
                         int oid_nr)
 {
@@ -30,6 +31,8 @@ static int fetch_objects(const char *remote_name,
                die(_("promisor-remote: unable to fork off fetch subprocess"));
        child_in = xfdopen(child.in, "w");
 
+       trace2_data_intmax("promisor", repo, "fetch_count", oid_nr);
+
        for (i = 0; i < oid_nr; i++) {
                if (fputs(oid_to_hex(&oids[i]), child_in) < 0)
                        die_errno(_("promisor-remote: could not write to fetch subprocess"));
@@ -238,7 +241,7 @@ int promisor_remote_get_direct(struct repository *repo,
        promisor_remote_init();
 
        for (r = promisors; r; r = r->next) {
-               if (fetch_objects(r->name, remaining_oids, remaining_nr) < 0) {
+               if (fetch_objects(repo, r->name, remaining_oids, remaining_nr) < 0) {
                        if (remaining_nr == 1)
                                continue;
                        remaining_nr = remove_fetched_oids(repo, &remaining_oids,