aboutsummaryrefslogtreecommitdiffstats
path: root/refs/debug.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-05-30 14:15:12 -0700
committerJunio C Hamano <gitster@pobox.com>2024-05-30 14:15:13 -0700
commit988499e2955f052fa5f58434e13d12285cb8a361 (patch)
treead9543a7d40203b97f72a37ed85c6eb7395ce88f /refs/debug.c
parentMerge branch 'ps/reftable-reusable-iterator' (diff)
parentrefs/packed: remove references to `the_hash_algo` (diff)
downloadgit-988499e2955f052fa5f58434e13d12285cb8a361.tar.gz
git-988499e2955f052fa5f58434e13d12285cb8a361.zip
Merge branch 'ps/refs-without-the-repository-updates'
Further clean-up the refs subsystem to stop relying on the_repository, and instead use the repository associated to the ref_store object. * ps/refs-without-the-repository-updates: refs/packed: remove references to `the_hash_algo` refs/files: remove references to `the_hash_algo` refs/files: use correct repository refs: remove `dwim_log()` refs: drop `git_default_branch_name()` refs: pass repo when peeling objects refs: move object peeling into "object.c" refs: pass ref store when detecting dangling symrefs refs: convert iteration over replace refs to accept ref store refs: retrieve worktree ref stores via associated repository refs: refactor `resolve_gitlink_ref()` to accept a repository refs: pass repo when retrieving submodule ref store refs: track ref stores via strmap refs: implement releasing ref storages refs: rename `init_db` callback to avoid confusion refs: adjust names for `init` and `init_db` callbacks
Diffstat (limited to 'refs/debug.c')
-rw-r--r--refs/debug.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/refs/debug.c b/refs/debug.c
index 8be316bb67..547d9245b9 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -33,11 +33,18 @@ struct ref_store *maybe_debug_wrap_ref_store(const char *gitdir, struct ref_stor
return (struct ref_store *)res;
}
-static int debug_init_db(struct ref_store *refs, int flags, struct strbuf *err)
+static void debug_release(struct ref_store *refs)
{
struct debug_ref_store *drefs = (struct debug_ref_store *)refs;
- int res = drefs->refs->be->init_db(drefs->refs, flags, err);
- trace_printf_key(&trace_refs, "init_db: %d\n", res);
+ drefs->refs->be->release(drefs->refs);
+ trace_printf_key(&trace_refs, "release\n");
+}
+
+static int debug_create_on_disk(struct ref_store *refs, int flags, struct strbuf *err)
+{
+ struct debug_ref_store *drefs = (struct debug_ref_store *)refs;
+ int res = drefs->refs->be->create_on_disk(drefs->refs, flags, err);
+ trace_printf_key(&trace_refs, "create_on_disk: %d\n", res);
return res;
}
@@ -415,7 +422,8 @@ static int debug_reflog_expire(struct ref_store *ref_store, const char *refname,
struct ref_storage_be refs_be_debug = {
.name = "debug",
.init = NULL,
- .init_db = debug_init_db,
+ .release = debug_release,
+ .create_on_disk = debug_create_on_disk,
/*
* None of these should be NULL. If the "files" backend (in