]> git.feebdaed.xyz Git - 0xmirror/git.git/commit
odb: stop splitting alternate in `odb_add_to_alternates_file()`
authorPatrick Steinhardt <ps@pks.im>
Thu, 11 Dec 2025 09:30:13 +0000 (10:30 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Dec 2025 09:39:36 +0000 (18:39 +0900)
commitdccfb39cdb68e47a4c7103b3c465cde91c5f9f56
treeebe3f2acb9b859ffd7f803159ee9df6e7dea8cb9
parentd17673ef4285d3d5f70909136f1ffe2745bcb71c
odb: stop splitting alternate in `odb_add_to_alternates_file()`

When calling `odb_add_to_alternates_file()` we know to add the newly
added source to the object database in case we have already loaded
alternates. This is done so that we can make its objects accessible
immediately without having to fully reload all alternates.

The way we do this though is to call `link_alt_odb_entries()`, which
adds _multiple_ sources to the object database source in case we have
newline-separated entries. This behaviour is not documented in the
function documentation of `odb_add_to_alternates_file()`, and all
callers only ever pass a single directory to it. It's thus entirely
surprising and a conceptual mismatch.

Fix this issue by directly calling `odb_add_alternate_recursively()`
instead.

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