refs: rename 'pack_refs_opts' to 'refs_optimize_opts'

The previous commit removed all references to 'pack_refs()' within
the refs subsystem. Continue this cleanup by also renaming
'pack_refs_opts' to 'refs_optimize_opts' and the respective flags
accordingly. Keeping the naming consistent will make the code easier to
maintain.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Karthik Nayak
2025-10-20 10:18:30 +02:00
committed by Junio C Hamano
parent 9b93ab8a9c
commit 2cd99d9841
8 changed files with 30 additions and 30 deletions

18
refs.h
View File

@@ -499,16 +499,16 @@ void refs_warn_dangling_symrefs(struct ref_store *refs, FILE *fp,
const struct string_list *refnames);
/*
* Flags for controlling behaviour of pack_refs()
* PACK_REFS_PRUNE: Prune loose refs after packing
* PACK_REFS_AUTO: Pack refs on a best effort basis. The heuristics and end
* result are decided by the ref backend. Backends may ignore
* this flag and fall back to a normal repack.
* Flags for controlling behaviour of refs_optimize()
* REFS_OPTIMIZE_PRUNE: Prune loose refs after packing
* REFS_OPTIMIZE_AUTO: Pack refs on a best effort basis. The heuristics and end
* result are decided by the ref backend. Backends may ignore
* this flag and fall back to a normal repack.
*/
#define PACK_REFS_PRUNE (1 << 0)
#define PACK_REFS_AUTO (1 << 1)
#define REFS_OPTIMIZE_PRUNE (1 << 0)
#define REFS_OPTIMIZE_AUTO (1 << 1)
struct pack_refs_opts {
struct refs_optimize_opts {
unsigned int flags;
struct ref_exclusions *exclusions;
struct string_list *includes;
@@ -518,7 +518,7 @@ struct pack_refs_opts {
* Optimize the ref store. The exact behavior is up to the backend.
* For the files backend, this is equivalent to packing refs.
*/
int refs_optimize(struct ref_store *refs, struct pack_refs_opts *opts);
int refs_optimize(struct ref_store *refs, struct refs_optimize_opts *opts);
/*
* Setup reflog before using. Fill in err and return -1 on failure.