]> git.feebdaed.xyz Git - 0xmirror/git.git/commit
odb: resolve relative alternative paths when parsing
authorPatrick Steinhardt <ps@pks.im>
Thu, 11 Dec 2025 09:30:11 +0000 (10:30 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Dec 2025 09:39:35 +0000 (18:39 +0900)
commit84cec5276e70bdabd651a3d0a250d006434d639f
tree314288cc6e537b27469af47c3fd510644373d7b5
parent1660496fc400b3956b4abe7bfc40351c9eddc168
odb: resolve relative alternative paths when parsing

Parsing alternates and resolving potential relative paths is currently
handled in two separate steps. This has the effect that the logic to
retrieve alternates is not entirely self-contained. We want it to be
just that though so that we can eventually move the logic to list
alternates into the `struct odb_source`.

Move the logic to resolve relative alternative paths into
`parse_alternates()`. Besides bringing us a step closer towards the
above goal, it also neatly separates concerns of generating the list of
alternatives and linking them into the object database.

Note that we ignore any errors when the relative path cannot be
resolved. This isn't really a change in behaviour though: if the path
cannot be resolved to a directory then `alt_odb_usable()` still knows to
bail out.

While at it, rename the function to `odb_add_alternate_recursively()` to
more clearly indicate what its intent is and to align it with modern
terminology.

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