]> git.ipfire.org Git - thirdparty/git.git/commit
path: adjust last remaining users of `the_repository`
authorPatrick Steinhardt <ps@pks.im>
Fri, 7 Feb 2025 11:03:41 +0000 (12:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Feb 2025 21:54:11 +0000 (13:54 -0800)
commit028f618658e34230e1d65678f14b6876e0f9856d
tree696b719e0dc2e67551193239522fbfb7113d1516
parentf1ce861c34bffbc02998173016b0bca0f6d9f6c4
path: adjust last remaining users of `the_repository`

With the preceding refactorings we now only have a couple of implicit
users of `the_repository` left in the "path" subsystem, all of which
depend on global state via `calc_shared_perm()`. Make the dependency on
`the_repository` explicit by passing the repo as a parameter instead and
adjust callers accordingly.

Note that this change bubbles up into a couple of subsystems that were
previously declared as free from `the_repository`. Instead of marking
all of them as `the_repository`-dependent again, we instead use the
repository that is available in the calling context. There are three
exceptions though with "copy.c", "pack-write.c" and "tempfile.c".
Adjusting these would require us to adapt callsites all over the place,
so this is left for a future iteration.

Mark "path.c" as free from `the_repository`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 files changed:
builtin/clone.c
commit-graph.c
copy.c
loose.c
midx-write.c
object-file.c
pack-bitmap-write.c
pack-write.c
path.c
path.h
read-cache.c
refs/files-backend.c
refs/reftable-backend.c
server-info.c
setup.c
tempfile.c
tmp-objdir.c