diff options
author | Elijah Newren <newren@gmail.com> | 2021-06-16 00:41:42 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-06-16 09:17:13 +0200 |
commit | 78cfdd0cf51f64ffe3cfe3173cbe40b871515681 (patch) | |
tree | e6f114fa18ffa36cd77e9655126834c9a63046e9 /promisor-remote.c | |
parent | The second batch (diff) | |
download | git-78cfdd0cf51f64ffe3cfe3173cbe40b871515681.tar.xz git-78cfdd0cf51f64ffe3cfe3173cbe40b871515681.zip |
promisor-remote: output trace2 statistics for number of objects fetched
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'promisor-remote.c')
-rw-r--r-- | promisor-remote.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/promisor-remote.c b/promisor-remote.c index da3f2ca261..d465377d7d 100644 --- a/promisor-remote.c +++ b/promisor-remote.c @@ -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, |