]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/worktree: move setup of commondir file earlier
authorPatrick Steinhardt <ps@pks.im>
Mon, 8 Jan 2024 10:05:39 +0000 (11:05 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Jan 2024 21:17:30 +0000 (13:17 -0800)
commit84f0ea956fbd3a3c9989a2d44da27881c0a5f546
tree4ca86e286d189818bb77e1185bf7d39bbbc5b9bb
parent2eb1d0c45271faf149a13b61bb74af52abd7b3aa
builtin/worktree: move setup of commondir file earlier

Shuffle around how we create supporting worktree files so that we first
ensure that the worktree has all link files ("gitdir", "commondir")
before we try to initialize the ref database by writing "HEAD". This
will be required by a subsequent commit where we start to initialize the
ref database via `refs_init_db()`, which will require an initialized
`struct worktree *`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c