@@ -226,8 +226,6 @@ static int create_default_files(const char *template_path,
* We need to create a "refs" dir in any case so that older
* versions of git can tell that this is a repository.
*/
- safe_create_dir(git_path("refs"), 1);
- adjust_shared_perm(git_path("refs"));
if (refs_init_db(&err))
die("failed to set up refs db: %s", err.buf);
@@ -3158,6 +3158,10 @@ static int files_init_db(struct ref_store *ref_store, struct strbuf *err)
files_downcast(ref_store, REF_STORE_WRITE, "init_db");
struct strbuf sb = STRBUF_INIT;
+ files_ref_path(refs, &sb, "refs");
+ safe_create_dir(sb.buf, 1);
+ // XXX adjust_shared_perm ?
+
/*
* Create .git/refs/{heads,tags}
*/