summaryrefslogtreecommitdiff
path: root/git-commit-script
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-07-07 09:21:21 +0200
committerJunio C Hamano <gitster@pobox.com>2026-07-07 10:49:40 -0700
commitc6799958b1e6c269a570e9a617986e4035e5756c (patch)
tree4b6695c6e0dce23576366280eba7ae3211a8e88b /git-commit-script
parent9ca3ea9881a1c1e238820ce3f6a63f6ad6fce4d5 (diff)
setup: mark bogus worktree in `apply_repository_format()`
When a repository is configured to have both "core.worktree" and "core.bare" we emit a warning and mark the worktree configuration as bogus so that the next call to `setup_work_tree()` will cause us to die. This allows us to still use the misconfigured repository, at least as long as we don't try to use its worktree. This condition is handled in `setup_explicit_git_dir()`. In a subsequent commit we'll refactor this function so that it doesn't receive a repo as input anymore though, and consequently we cannot set the "bogus" bit anymore. Move the logic into `apply_repository_format()` instead to prepare for this. While at it, fix up formatting a bit. Note that this change requires us to also explicitly unset the value of "core.worktree" in case we have the "GIT_WORK_TREE" environment variable set. This is because the environment variable overrides the repository's configuration, and we don't want to warn or die in case the work tree has been configured explicitly regardless of whether or not "core.bare" is set. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-commit-script')
0 files changed, 0 insertions, 0 deletions