]> git.ipfire.org Git - thirdparty/git.git/commit
refs: move to using the '.optimize' functions
authorKarthik Nayak <karthik.188@gmail.com>
Mon, 20 Oct 2025 08:18:29 +0000 (10:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Nov 2025 15:35:12 +0000 (07:35 -0800)
commit9b93ab8a9c61c53b3b9b2b3ba60c3e5d66b8ff56
tree5c551a30e3019473e8a8fd3d9980c5fd35db7d66
parentaec5adb4b70e1fa58d4a7cfc3fb07913733f7e90
refs: move to using the '.optimize' functions

The `struct ref_store` variable exposes two ways to optimize a reftable
backend:

  1. pack_refs
  2. optimize

The former was specific to the 'files' + 'packed' refs backend. The
latter is more generic and covers all backends. While the naming is
different, both of these functions perform the same functionality.

Consolidate this code to only maintain the 'optimize' functions. Do this
by modifying the backends so that they exclusively implement the
`optimize` callback, only. All users of the refs subsystem already use
the 'optimize' function so there is no changes needed on the callee
side. Finally, cleanup all references to the 'pack_refs' field of the
structure and code around it.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs.h
refs/debug.c
refs/files-backend.c
refs/packed-backend.c
refs/refs-internal.h
refs/reftable-backend.c