summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-12-11 10:30:14 +0100
committerJunio C Hamano <gitster@pobox.com>2025-12-11 18:39:36 +0900
commit430e0e0f2e75673206321f6f4942c0bc7856c8b7 (patch)
tree85227bf68a0415f327c55724ed29759cc57e60d3 /contrib/persistent-https
parentdccfb39cdb68e47a4c7103b3c465cde91c5f9f56 (diff)
downloadgit-430e0e0f2e75673206321f6f4942c0bc7856c8b7.tar.gz
git-430e0e0f2e75673206321f6f4942c0bc7856c8b7.zip
odb: remove mutual recursion when parsing alternates
When adding an alternative object database source we not only have to consider the added source itself, but we also have to add _its_ sources to our database. We implement this via mutual recursion: 1. We first call `link_alt_odb_entries()`. 2. `link_alt_odb_entries()` calls `parse_alternates()`. 3. We then add each alternate via `odb_add_alternate_recursively()`. 4. `odb_add_alternate_recursively()` calls `link_alt_odb_entries()` again. This flow is somewhat hard to follow, but more importantly it means that parsing of alternates is somewhat tied to the recursive behaviour. Refactor the function to remove the mutual recursion between adding sources and parsing alternates. The parsing step thus becomes completely oblivious to the fact that there is recursive behaviour going on at all. The recursion is handled by `odb_add_alternate_recursively()` instead, which now recurses with itself. This refactoring allows us to move parsing of alternates into object database sources in a subsequent step. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions