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>
Xinyu Ruan committed
Oct 24, 2025 at 08:38 UTC
6661cde2bef0cdb1649be1f1b5f95af7c08a6059
1 file changed
+9
refs/debug.c
+9
@@ -47,6 +47,14 @@ static int debug_create_on_disk(struct ref_store *refs, int flags, struct strbuf
47
return res;
48
}
49
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
+
58
static int debug_transaction_prepare(struct ref_store *refs,
59
struct ref_transaction *transaction,
60
struct strbuf *err)
@@ -432,6 +440,7 @@ struct ref_storage_be refs_be_debug = {
440
.init = NULL,
441
.release = debug_release,
442
.create_on_disk = debug_create_on_disk,
443
+ .remove_on_disk = debug_remove_on_disk,
444
445
/*
446
* None of these should be NULL. If the "files" backend (in