summaryrefslogtreecommitdiff
path: root/refs/files-backend.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-01-10 11:52:51 -0800
committerJunio C Hamano <gitster@pobox.com>2022-01-10 11:52:51 -0800
commit01ea04f76e096c0c371e475c3a277e67b8f4b082 (patch)
tree0e4028c2e2964f92657221a981fbebc41fe49c67 /refs/files-backend.c
parent3c0e4178277dee1cdc4607d7277a368379b12b3f (diff)
parentf9f7fd3b238cc56224c30235a0d248d027b7ecfa (diff)
Merge branch 'hn/refs-debug-update'
Debugging support for refs API. * hn/refs-debug-update: refs: centralize initialization of the base ref_store. refs: print error message in debug output refs: pass gitdir to packed_ref_store_create
Diffstat (limited to 'refs/files-backend.c')
-rw-r--r--refs/files-backend.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 90b671025a..5c6d49a267 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -86,16 +86,12 @@ static struct ref_store *files_ref_store_create(struct repository *repo,
struct ref_store *ref_store = (struct ref_store *)refs;
struct strbuf sb = STRBUF_INIT;
- ref_store->repo = repo;
- ref_store->gitdir = xstrdup(gitdir);
- base_ref_store_init(ref_store, &refs_be_files);
+ base_ref_store_init(ref_store, repo, gitdir, &refs_be_files);
refs->store_flags = flags;
-
get_common_dir_noenv(&sb, gitdir);
refs->gitcommondir = strbuf_detach(&sb, NULL);
- strbuf_addf(&sb, "%s/packed-refs", refs->gitcommondir);
- refs->packed_ref_store = packed_ref_store_create(repo, sb.buf, flags);
- strbuf_release(&sb);
+ refs->packed_ref_store =
+ packed_ref_store_create(repo, refs->gitcommondir, flags);
chdir_notify_reparent("files-backend $GIT_DIR", &refs->base.gitdir);
chdir_notify_reparent("files-backend $GIT_COMMONDIR",