refs/reftable: print errors on compaction failure

When git-pack-refs(1) fails in the reftable backend we end up printing
no error message at all, leaving the caller puzzled as to why compaction
has failed. Fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-03-25 11:02:54 +01:00
committed by Junio C Hamano
parent a2f711ade0
commit 4ccf7060d8
2 changed files with 17 additions and 1 deletions

View File

@ -1221,8 +1221,12 @@ static int reftable_be_pack_refs(struct ref_store *ref_store,
stack = refs->main_stack;
ret = reftable_stack_compact_all(stack, NULL);
if (ret)
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;