summaryrefslogtreecommitdiff
path: root/t/unit-tests
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-08-11 15:46:45 +0200
committerJunio C Hamano <gitster@pobox.com>2025-08-11 09:22:22 -0700
commit57363dfa0dce05aac735d5cfd626e6aac8cb706c (patch)
tree0dc9f9f2dea2686e83e183ebf5c2222b3df68eda /t/unit-tests
parenta59d44ff3f0f308f9577b05c858c063d2466b061 (diff)
odb: simplify calling `link_alt_odb_entry()`
Callers of `link_alt_odb_entry()` are expected to pass in three different paths: - The (potentially relative) path of the object directory that we're about to add. - The base that should be used to resolve a relative object directory path. - The resolved path to the object database's objects directory. Juggling those three paths makes the calling convention somewhat hard to grok at first. As it turns out, the third parameter is redundant: we always pass in the resolved path of the object database's primary source, and we already pass in the database itself. So instead, we can resolve that path in the function itself. One downside of this is that one caller of `link_alt_odb_entry()` calls this function in a loop, so we were able to resolve the directory a single time, only. But ultimately, we only ever end up with a rather limited number of alternates anyway, so the extra couple of cycles we save feels more like a micro optimization. Refactor the code accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests')
0 files changed, 0 insertions, 0 deletions