git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "RuanXinyu via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: RuanXinyu <1096421257@qq.com>, RuanXinyu <r200981113@gmail.com>
Subject: [PATCH] refs: add missing remove_on_disk implementation for debug backend
Date: Fri, 24 Oct 2025 08:38:14 +0000	[thread overview]
Message-ID: <pull.2082.git.git.1761295094982.gitgitgadget@gmail.com> (raw)

From: RuanXinyu <r200981113@gmail.com>

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>
---
    refs: add missing remove_on_disk implementation for debug backend

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2082%2FRuanXinyu%2Ffix-refs-trace-migrate-error-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2082/RuanXinyu/fix-refs-trace-migrate-error-v1
Pull-Request: https://github.com/git/git/pull/2082

 refs/debug.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/refs/debug.c b/refs/debug.c
index da300efaf3..dd49080836 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -48,6 +48,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

base-commit: 81f86aacc4eb74cdb9c2c8082d36d2070c666045
-- 
gitgitgadget


             reply	other threads:[~2025-10-24  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24  8:38 RuanXinyu via GitGitGadget [this message]
2025-10-24  9:11 ` [PATCH] refs: add missing remove_on_disk implementation for debug backend Patrick Steinhardt
2025-10-24 15:13   ` Junio C Hamano
2025-10-27  4:01     ` 阮新宇

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.2082.git.git.1761295094982.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=1096421257@qq.com \
    --cc=git@vger.kernel.org \
    --cc=r200981113@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).