Merge branch 'ms/refs-optimize'

"git refs optimize" is added for not very well explained reason
despite it does the same thing as "git pack-refs"...

* ms/refs-optimize:
  t: add test for git refs optimize subcommand
  t0601: refactor tests to be shareable
  builtin/refs: add optimize subcommand
  doc: pack-refs: factor out common options
  builtin/pack-refs: factor out core logic into a shared library
  builtin/pack-refs: convert to use the generic refs_optimize() API
  reftable-backend: implement 'optimize' action
  files-backend: implement 'optimize' action
  refs: add a generic 'optimize' API
This commit is contained in:
Junio C Hamano
2025-10-02 12:26:12 -07:00
18 changed files with 647 additions and 530 deletions

6
refs.h
View File

@@ -482,6 +482,12 @@ struct pack_refs_opts {
*/
int refs_pack_refs(struct ref_store *refs, struct pack_refs_opts *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);
/*
* Setup reflog before using. Fill in err and return -1 on failure.
*/