aboutsummaryrefslogtreecommitdiffstats
path: root/refs/files-backend.c
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-12-22 18:11:52 +0000
committerJunio C Hamano <gitster@pobox.com>2021-12-22 13:51:37 -0800
commit99f0d97b736e80fb2f92f8a1a5fbc65b68c2a1b9 (patch)
tree5ec03c9d6afdc540ccc68de2bf56bc54cbb3098c /refs/files-backend.c
parentThe fourth batch (diff)
downloadgit-99f0d97b736e80fb2f92f8a1a5fbc65b68c2a1b9.tar.gz
git-99f0d97b736e80fb2f92f8a1a5fbc65b68c2a1b9.zip
refs: pass gitdir to packed_ref_store_create
This is consistent with the calling convention for ref backend creation, and avoids storing ".git/packed-refs" (the name of a regular file) in a variable called ref_store::gitdir. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
-rw-r--r--refs/files-backend.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 90b671025a..f1b66130df 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -93,9 +93,8 @@ static struct ref_store *files_ref_store_create(struct repository *repo,
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",