]> git.99rst.org Git - git.git/commit
builtin/init: stop modifying `is_bare_repository_cfg`
authorPatrick Steinhardt <redacted>
Thu, 11 Jun 2026 06:44:42 +0000 (08:44 +0200)
committerJunio C Hamano <redacted>
Thu, 11 Jun 2026 12:05:54 +0000 (05:05 -0700)
commitf12d73132ea23788167a6b21fad63d85c76fa863
tree0a6b611b4b35038230d01e498da536d0d76ff829
parent85f5f504f046bccf86b78ba02064a4b013d7264f
builtin/init: stop modifying `is_bare_repository_cfg`

We're modifying `is_bare_repository_cfg` in "builtin/init.c" to indicate
whether the newly created repository is supposed to be a bare repository
or not.

This is ultimately unnecessary though: when initializing the repository
in `init_db()` we eventually set `is_bare_repository_cfg = !work_tree`,
so all that matters is whether or not we have a working tree configured,
and the working tree is set up in the non-bare in "builtin/init.c".

Stop modifying the global variable in "builtin/init.c" in favor of a
local variable.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/init-db.c
git clone https://git.99rst.org/PROJECT