diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-04-05 10:34:23 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-04-05 10:34:23 -0700 |
| commit | 7424fb779752c77f68d1cc793cd5c6cc3cc60971 (patch) | |
| tree | b5fd5b5fd0dfff1a8e4e5173f5d27d0e011e7dcb /refs | |
| parent | d6fd04375f9196f8b203d442f235bd96a1a068cc (diff) | |
| parent | 9f6714ab3e61ad58c4532077d4b8dc807ff0410d (diff) | |
| download | git-7424fb779752c77f68d1cc793cd5c6cc3cc60971.tar.xz | |
Merge branch 'ps/pack-refs-auto' into jt/reftable-geometric-compaction
* ps/pack-refs-auto:
builtin/gc: pack refs when using `git maintenance run --auto`
builtin/gc: forward git-gc(1)'s `--auto` flag when packing refs
t6500: extract objects with "17" prefix
builtin/gc: move `struct maintenance_run_opts`
builtin/pack-refs: introduce new "--auto" flag
builtin/pack-refs: release allocated memory
refs/reftable: expose auto compaction via new flag
refs: remove `PACK_REFS_ALL` flag
refs: move `struct pack_refs_opts` to where it's used
t/helper: drop pack-refs wrapper
refs/reftable: print errors on compaction failure
reftable/stack: gracefully handle failed auto-compaction due to locks
reftable/stack: use error codes when locking fails during compaction
reftable/error: discern locked/outdated errors
reftable/stack: fix error handling in `reftable_stack_init_addition()`
Diffstat (limited to 'refs')
| -rw-r--r-- | refs/reftable-backend.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c index e206d5a073..0bed6d2ab4 100644 --- a/refs/reftable-backend.c +++ b/refs/reftable-backend.c @@ -1203,9 +1203,16 @@ static int reftable_be_pack_refs(struct ref_store *ref_store, if (!stack) stack = refs->main_stack; - ret = reftable_stack_compact_all(stack, NULL); - if (ret) + if (opts->flags & PACK_REFS_AUTO) + ret = reftable_stack_auto_compact(stack); + else + ret = reftable_stack_compact_all(stack, NULL); + if (ret < 0) { + ret = error(_("unable to compact stack: %s"), + reftable_error_str(ret)); goto out; + } + ret = reftable_stack_clean(stack); if (ret) goto out; |
