summaryrefslogtreecommitdiff
path: root/promisor-remote.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-06-15 22:41:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-06-16 07:17:13 (GMT)
commit78cfdd0cf51f64ffe3cfe3173cbe40b871515681 (patch)
treee6f114fa18ffa36cd77e9655126834c9a63046e9 /promisor-remote.c
parent670b81a890388c60b7032a4f5b879f2ece8c4558 (diff)
downloadgit-78cfdd0cf51f64ffe3cfe3173cbe40b871515681.zip
git-78cfdd0cf51f64ffe3cfe3173cbe40b871515681.tar.gz
git-78cfdd0cf51f64ffe3cfe3173cbe40b871515681.tar.bz2
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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/promisor-remote.c b/promisor-remote.c
index da3f2ca..d465377 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,