]> git.99rst.org Git - git.git/commitdiff
refs: add missing remove_on_disk implementation for debug backend
authorXinyu Ruan <redacted>
Fri, 24 Oct 2025 08:38:14 +0000 (08:38 +0000)
committerJunio C Hamano <redacted>
Mon, 27 Oct 2025 15:57:47 +0000 (08:57 -0700)
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 <redacted>
Acked-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
refs/debug.c

index 697adbd0dc3f65f2f591f9d7ee9e874a17a7230f..c59c1728a3d31cfe4a79d0361b0dc77f1f1faf49 100644 (file)
@@ -47,6 +47,14 @@ static int debug_create_on_disk(struct ref_store *refs, int flags, struct strbuf
        return res;
 }
 
+static int debug_remove_on_disk(struct ref_store *refs, struct strbuf *err)
+{
+       struct debug_ref_store *drefs = (struct debug_ref_store *)refs;
+       int res = drefs->refs->be->remove_on_disk(drefs->refs, err);
+       trace_printf_key(&trace_refs, "remove_on_disk: %d\n", res);
+       return res;
+}
+
 static int debug_transaction_prepare(struct ref_store *refs,
                                     struct ref_transaction *transaction,
                                     struct strbuf *err)
@@ -432,6 +440,7 @@ struct ref_storage_be refs_be_debug = {
        .init = NULL,
        .release = debug_release,
        .create_on_disk = debug_create_on_disk,
+       .remove_on_disk = debug_remove_on_disk,
 
        /*
         * None of these should be NULL. If the "files" backend (in
git clone https://git.99rst.org/PROJECT