git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] promisor-remote: remove the promisor object check for failed fetch
@ 2025-05-28  9:58 Han Young
  2025-05-29 15:23 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Han Young @ 2025-05-28  9:58 UTC (permalink / raw)
  To: git; +Cc: chriscool, jonathantanmy, Han Young

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@bytedance.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-30 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-28  9:58 [PATCH] promisor-remote: remove the promisor object check for failed fetch Han Young
2025-05-29 15:23 ` Junio C Hamano
2025-05-30 13:26   ` [External] " Han Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).