summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff_initial..side
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-06-11 08:44:41 +0200
committerJunio C Hamano <gitster@pobox.com>2026-06-11 05:05:54 -0700
commit85f5f504f046bccf86b78ba02064a4b013d7264f (patch)
treeb62e406a821d1e91f848760ed2309ad55ba8c954 /t/t4013/diff.diff_initial..side
parent65eb5b989aa6d7f764d097c6759f6b6189eb0d27 (diff)
setup: remove global `git_work_tree_cfg` variable
The global `git_work_tree_cfg` variable used to be modified by both "setup.c" and by "builtin/init-db.c". We have refactored the latter user to not use that variable at all anymore in a preceding commit, which makes "setup.c" the only remaining user. Even for "setup.c" it is unnecessary though, as we only ever set it to the value we have stored in the discovered repository format. The consequence is that we only ever set it in case we already have it set to the same value in our discovered repository format, which makes it redundant. Refactor the code so that we instead use the worktree configuration as discovered via the repository format. Drop the global variable. Note that in `check_repository_format_gently()` we now have to free the candidate work tree variable. This change is required to retain previous semantics: before we essentially had an implicit `else` branch where we set `git_work_tree_cfg = NULL`, but we were able to elide that branch because we already knew that it would be `NULL` anyway. Now that we use the candidate work tree directly to populate the repository's work tree though we have to clear it to retain those semantics. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions