]> git.feebdaed.xyz Git - 0xmirror/git.git/commit
odb: refactor parsing of alternates to be self-contained
authorPatrick Steinhardt <ps@pks.im>
Thu, 11 Dec 2025 09:30:10 +0000 (10:30 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Dec 2025 09:39:34 +0000 (18:39 +0900)
commit1660496fc400b3956b4abe7bfc40351c9eddc168
tree8b0f54e1ae974ea171191ec0ffbadab4e790ed75
parentbdc5341ff65278a3cc80b2e8a02a2f02aa1fac06
odb: refactor parsing of alternates to be self-contained

Parsing of the alternates file and environment variable is currently
split up across multiple different functions and is entangled with
`link_alt_odb_entries()`, which is responsible for linking the parsed
object database sources. This results in two downsides:

  - We have mutual recursion between parsing alternates and linking them
    into the object database. This is because we also parse alternates
    that the newly added sources may have.

  - We mix up the actual logic to parse the data and to link them into
    place.

Refactor the logic so that parsing of the alternates file is entirely
self-contained. Note that this doesn't yet fix the above two issues, but
it is a necessary step to get there.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
odb.c