Thread (158 messages) 158 messages, 3 authors, 2025-10-16

Re: [PATCH 43/49] repack: extract `write_pack_opts_is_local()`

From: Patrick Steinhardt <hidden>
Date: 2025-10-10 12:29:03

On Sun, Sep 28, 2025 at 06:10:08PM -0400, Taylor Blau wrote:
quoted hunk ↗ jump to hunk
diff --git a/repack.c b/repack.c
index c4326a532d..7af297ae48 100644
--- a/repack.c
+++ b/repack.c
@@ -77,6 +77,12 @@ const char *write_pack_opts_pack_prefix(struct write_pack_opts *opts)
 	return pack_prefix;
 }
 
+int write_pack_opts_is_local(struct write_pack_opts *opts)
+{
+	const char *scratch;
+	return skip_prefix(opts->destination, opts->packdir, &scratch);
+}
+
 #define DELETE_PACK 1
 #define RETAIN_PACK 2
 
Now that we accept booleans in our codebase, should this function return
a `bool` instead?
quoted hunk ↗ jump to hunk
diff --git a/repack.h b/repack.h
index 46d2312fa9..16f2de2ea9 100644
--- a/repack.h
+++ b/repack.h
@@ -40,6 +40,7 @@ struct write_pack_opts {
 };
 
 const char *write_pack_opts_pack_prefix(struct write_pack_opts *opts);
+int write_pack_opts_is_local(struct write_pack_opts *opts);
It would be good if all of these these new library functions could come
with some documentation what they actually do.

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