If the promisor objects fail to fetch, we check the remaining objects to see if they are indeed promisor objects. Then, we die on the first remaining promisor object. However, this promisor object check is unnecessary because callers of promisor_remote_get_direct already filter out local objects. All objects passed to promisor_remote_get_direct are promisor objects. The is_promisor_object check essentially iterates through every object in the local packfiles and adds them to an oid set. This process is agonizingly slow for large repositories. Remove the check so that we fail immediately. Signed-off-by: Han Young <hanyang.tony@xxxxxxxxxxxxx> --- promisor-remote.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/promisor-remote.c b/promisor-remote.c index 9d058586df..f42ea4ce78 100644 --- a/promisor-remote.c +++ b/promisor-remote.c @@ -275,7 +275,6 @@ void promisor_remote_get_direct(struct repository *repo, struct object_id *remaining_oids = (struct object_id *)oids; int remaining_nr = oid_nr; int to_free = 0; - int i; if (oid_nr == 0) return; @@ -296,10 +295,9 @@ void promisor_remote_get_direct(struct repository *repo, goto all_fetched; } - for (i = 0; i < remaining_nr; i++) { - if (is_promisor_object(repo, &remaining_oids[i])) - die(_("could not fetch %s from promisor remote"), - oid_to_hex(&remaining_oids[i])); + if (remaining_nr) { + die(_("could not fetch %s from promisor remote"), + oid_to_hex(&remaining_oids[0])); } all_fetched: -- 2.48.1