Re: [PATCH 09/16] packfile: split up responsibilities of `reprepare_packed_git()`
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Aug 20, 2025, 13:17 UTC
- Message-ID
- <CAOLa=ZQbeyqdGn1Hj0Utys9UgiUbB4cP4WTsy4fisyZ5czsCcA@mail.gmail.com>
- In-Reply-To
- <20250819-b4-pks-packfiles-store-v1-9-1660842e125a@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 15 quoted lines
> In `reprepare_packed_git()` we perform a couple of operations: > > - We reload alternate object directories. > > - We clear the loose object cache. > > - We reprepare packfiles. > > While the logic is hosted in "packfile.c", it clearly reaches into other > subsystems that aren't related to packfiles. > > Split up the responsibility and introduce `odb_reprepare()` which now > becomes responsible for repreparing the whole object database. The > existing `reprepare_packed_git()` function is refactored accordingly and > only cares about reloading the packfile store now.
[snip]
Show 14 quoted lines
> diff --git a/odb.h b/odb.h
> index f1736b067c..9810ec60a0 100644
> --- a/odb.h
> +++ b/odb.h
> @@ -155,6 +155,12 @@ struct object_database {
> struct object_database *odb_new(struct repository *repo);
> void odb_clear(struct object_database *o);
>
> +/*
> + * Clear caches, reload alternates and then reload object sources so that new
> + * objects may become accessible.
> + */
> +void odb_reprepare(struct object_database *o);
>I was first wondering why you don't go into details like mentioning the packile cleanup. But since we eventually will move it into its own object source, this reads better.