aboutsummaryrefslogtreecommitdiffstats
path: root/refs/debug.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-05-23 09:14:08 -0700
committerJunio C Hamano <gitster@pobox.com>2024-05-23 09:14:08 -0700
commite55f364398be3cfae6243ada1a6a8bb66ea7cc46 (patch)
treeb06054ea8aef86c3ea920c5b73b99ccffd26b11d /refs/debug.c
parent4365c6fcf96caac73dcc412aa25db34cf8df48d5 (diff)
parent00892786b83936ec53d7d38df9bfc4e180fc2e19 (diff)
downloadgit-e55f364398be3cfae6243ada1a6a8bb66ea7cc46.tar.gz
Merge branch 'ps/refs-without-the-repository-updates' into ps/ref-storage-migration
* 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