Thread (1 message) 1 message, 1 author, 2025-09-18

Re: [GSoC][PATCH v3 1/9] refs: add a generic 'optimize' API

From: Junio C Hamano <hidden>
Date: 2025-09-18 15:39:56

shejialuo [off-list ref] writes:
quoted
diff --git a/refs.c b/refs.c
index 4ff55cf24f..2ea6fd2218 100644
--- a/refs.c
+++ b/refs.c
@@ -2282,6 +2282,13 @@ int refs_pack_refs(struct ref_store *refs, struct pack_refs_opts *opts)
 	return refs->be->pack_refs(refs, opts);
 }
 
+int refs_optimize(struct ref_store *refs, struct pack_refs_opts *opts)
+{
+	if (!refs->be->optimize)
+		return 0;
I don't think we need to check `refs->be->optimize`. Even though for
some backends, we won't do any optimization, we should register this
callback instead of assigning `NULL`.
Yeah, all the existing functions at the refs.c level simply assumes
that refs->be->method always exists, and it would be sensible to be
coherent with them.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help