mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
aec5adb4b7
commit
9b93ab8a9c
6
refs.c
6
refs.c
@@ -2313,12 +2313,6 @@ void base_ref_store_init(struct ref_store *refs, struct repository *repo,
|
||||
refs->gitdir = xstrdup(path);
|
||||
}
|
||||
|
||||
/* backend functions */
|
||||
int refs_pack_refs(struct ref_store *refs, struct pack_refs_opts *opts)
|
||||
{
|
||||
return refs->be->pack_refs(refs, opts);
|
||||
}
|
||||
|
||||
int refs_optimize(struct ref_store *refs, struct pack_refs_opts *opts)
|
||||
{
|
||||
return refs->be->optimize(refs, opts);
|
||||
|
||||
Reference in New Issue
Block a user