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>
This commit is contained in:
committed by
Junio C Hamano
parent
597af311a2
commit
99f0d97b73
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user