]> git.99rst.org Git - git.git/commit
setup: split up concerns of `setup_git_env_internal()`
authorPatrick Steinhardt <redacted>
Tue, 7 Jul 2026 07:21:23 +0000 (09:21 +0200)
committerJunio C Hamano <redacted>
Tue, 7 Jul 2026 17:49:40 +0000 (10:49 -0700)
commitcf1687a41c9fc7dc9c640201303c626be54464cc
treedd91548170dd0f7e20d1f63c6c504d94df2d1607
parentd43b9acb05b666627e63f9e5fe25a818ca4c2aba
setup: split up concerns of `setup_git_env_internal()`

The function `setup_git_env_internal()` does two completely unrelated
things:

  - It configures the repository's gitdir and propagates environment
    variables into it.

  - It configures a couple of global parameters via environment
    variables.

The function is called when we initialize the repository's path, but
it's also called via `chdir_notify_register()` whenever we change the
current working directory. While we indeed have to reconfigure the
gitdir in case it's a relative path, it doesn't make sense to reapply
the global environment variables.

Split up concerns of this function along the above delineation. Handling
of the global environment variables is moved into `init_git()`, as they
can be considered part of our setup procedure.

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