Skip to content

Commit 6661cde

Browse files
RuanXinyugitster
authored andcommitted
refs: add missing remove_on_disk implementation for debug backend
The debug ref backend (refs_be_debug) was missing the remove_on_disk function pointer, which caused a segmentation fault when running 'GIT_TRACE_REFS=1 git refs migrate --ref-format=reftable' commands. Signed-off-by: Xinyu Ruan <r200981113@gmail.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 419c72c commit 6661cde

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

refs/debug.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ static int debug_create_on_disk(struct ref_store *refs, int flags, struct strbuf
4747
return res;
4848
}
4949

50+
static int debug_remove_on_disk(struct ref_store *refs, struct strbuf *err)
51+
{
52+
struct debug_ref_store *drefs = (struct debug_ref_store *)refs;
53+
int res = drefs->refs->be->remove_on_disk(drefs->refs, err);
54+
trace_printf_key(&trace_refs, "remove_on_disk: %d\n", res);
55+
return res;
56+
}
57+
5058
static int debug_transaction_prepare(struct ref_store *refs,
5159
struct ref_transaction *transaction,
5260
struct strbuf *err)
@@ -432,6 +440,7 @@ struct ref_storage_be refs_be_debug = {
432440
.init = NULL,
433441
.release = debug_release,
434442
.create_on_disk = debug_create_on_disk,
443+
.remove_on_disk = debug_remove_on_disk,
435444

436445
/*
437446
* None of these should be NULL. If the "files" backend (in

0 commit comments

Comments
 (0)