]> git.ipfire.org Git - thirdparty/git.git/commit
environment: guard state depending on a repository
authorPatrick Steinhardt <ps@pks.im>
Thu, 12 Sep 2024 11:30:01 +0000 (13:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Sep 2024 17:15:42 +0000 (10:15 -0700)
commit673af418d0f271faadb24486348430e547d32d2a
tree350e205229a62ed858d512a2b578ef36bf49cb98
parentf2d70847bd21f00045700aebca023f9c07ba87ac
environment: guard state depending on a repository

In "environment.h" we have quite a lot of functions and variables that
either explicitly or implicitly depend on `the_repository`.

The implicit set of stateful declarations includes for example variables
which get populated when parsing a repository's Git configuration. This
set of variables is broken by design, as their state often depends on
the last repository config that has been parsed. So they may or may not
represent the state of `the_repository`.

Fixing that is quite a big undertaking, and later patches in this series
will demonstrate a solution for a first small set of those variables. So
for now, let's guard these with `USE_THE_REPOSITORY_VARIABLE` so that
callers are aware of the implicit dependency.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 files changed:
compat/mingw.c
compat/win32/path-utils.c
config.c
environment.h
name-hash.c
path.c
preload-index.c
prompt.c
refs/files-backend.c
sparse-index.c
statinfo.c
t/helper/test-path-utils.c
tree-diff.c
userdiff.c