Re: [PATCH 43/49] repack: extract `write_pack_opts_is_local()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 10, 2025, 12:28 UTC
- Message-ID
- <aOj8CUgapqZEhnlK@pks.im>
- In-Reply-To
- <1fbe3d0d7f37840b2d9faf6f62e94abd6a664ded.1759097191.git.me@ttaylorr.com>
On Sun, Sep 28, 2025 at 06:10:08PM -0400, Taylor Blau wrote:
Show 17 quoted lines
> 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?
Show 9 quoted lines
> 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