Thread (11 messages) flat view 11 messages, 3 authors, 2026-01-14

Re: [PATCH 2/5] repack-geometry: extract function to compute repacking split

From: Toon Claes <hidden>
Date: 2026-01-14 12:25:05

Patrick Steinhardt [off-list ref] writes:
quoted hunk ↗ jump to hunk
We're about to add a second caller that wants to compute the repacking
split for a set of packfiles. Split out the function that computes this
split to prepare for that.

Signed-off-by: Patrick Steinhardt <redacted>
---
 repack-geometry.c | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/repack-geometry.c b/repack-geometry.c
index b3e32cd07e..17e6652a91 100644
--- a/repack-geometry.c
+++ b/repack-geometry.c
@@ -78,33 +78,32 @@ void pack_geometry_init(struct pack_geometry *geometry,
 	strbuf_release(&buf);
 }
 
-void pack_geometry_split(struct pack_geometry *geometry)
+static uint32_t compute_pack_geometry_split(struct packed_git **pack, size_t pack_nr,
+					    int split_factor)
 {
 	uint32_t i;
 	uint32_t split;
 	off_t total_size = 0;
 
-	if (!geometry->pack_nr) {
-		geometry->split = geometry->pack_nr;
-		return;
-	}
+	if (!pack_nr)
+		return 0;
Thanks for making this easier to read now. Took me a while to realize
they behave identical.


-- 
Cheers,
Toon
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help