Re: [PATCH 1/7] setup: extract function to create the refdb
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Dec 6, 2023, 21:10 UTC
- Message-ID
- <CAOLa=ZSZztJUF9nmSzGdOW0oWBRUp2sw8QyuZO_q06cNymad3Q@mail.gmail.com>
- In-Reply-To
- <b69c57d27269c9b40c9e4394861dffd8a8b9860c.1701863960.git.ps@pks.im>
On Wed, Dec 6, 2023 at 1:40 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 9 quoted lines
> +static void create_reference_database(const char *initial_branch, int quiet)
> +{
> + struct strbuf err = STRBUF_INIT;
> + int reinit = is_reinit();
> +
> + /*
> + * We need to create a "refs" dir in any case so that older
> + * versions of git can tell that this is a repository.
> + */How does this work though, even if an earlier version of git can tell that this is a repository, it still won't be able to read the reftable backend. In that sense, what do we achieve here?
> + safe_create_dir(git_path("refs"), 1);
> + adjust_shared_perm(git_path("refs"));
> +Not related to your commit per se, but we ignore the return value here, shouldn't we die in this case?