From: Patrick Steinhardt Date: Tue, 06 Oct 2026 10:20:14 GMT Subject: [PATCH v2 1/2] packfile: move around `close_pack()` Message-ID: <20261006-pks-packfile-stale-delta-base-cache-v2-1-69669a2fc6ce@pks.im> In-Reply-To: <20261006-pks-packfile-stale-delta-base-cache-v2-0-69669a2fc6ce@pks.im> In the next commit we'll want to access the delta base cache in `close_pack()`. Move the function after the declaration of the cache so that we won't need a forward declaration. Signed-off-by: Patrick Steinhardt --- packfile.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packfile.c b/packfile.c index 4fa5fd67c8..af1b837974 100644 --- a/packfile.c +++ b/packfile.c @@ -355,16 +355,6 @@ static void close_pack_mtimes(struct packed_git *p) p->mtimes_map = NULL; } -void close_pack(struct packed_git *p) -{ - close_pack_windows(p); - close_pack_fd(p); - close_pack_index(p); - close_pack_revindex(p); - close_pack_mtimes(p); - oidset_clear(&p->bad_objects); -} - void unlink_pack_path(const char *pack_name, int force_delete) { static const char *exts[] = {".idx", ".pack", ".rev", ".keep", ".bitmap", ".promisor", ".mtimes"}; @@ -1263,6 +1253,16 @@ void clear_delta_base_cache(void) } } +void close_pack(struct packed_git *p) +{ + close_pack_windows(p); + close_pack_fd(p); + close_pack_index(p); + close_pack_revindex(p); + close_pack_mtimes(p); + oidset_clear(&p->bad_objects); +} + static void add_delta_base_cache(struct packed_git *p, off_t base_offset, void *base, size_t base_size, size_t delta_base_cache_limit, -- 2.56.0.406.ga2d225a756.dirty