]> git.ipfire.org Git - thirdparty/git.git/commit
repository: stop reading loose object map twice on repo init
authorPatrick Steinhardt <ps@pks.im>
Tue, 26 May 2026 05:57:02 +0000 (07:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 May 2026 11:07:03 +0000 (20:07 +0900)
commita8868c69a3d4051c096890912d0fabb21f652b28
treee03c1fe9ee2a1a6a508993ba474ec0cd81330866
parent62dd5946f2092345e338f0e4bf1e72f26cb03896
repository: stop reading loose object map twice on repo init

When initializing a repository via `repo_init()` we end up reading the
loose object map twice:

  - `apply_repository_format()` calls `repo_set_compat_hash_algo()`,
    which in turn calls `repo_read_loose_object_map()` if we have a
    compatibility hash configured.

  - `repo_init()` calls `repo_read_loose_object_map()` directly a second
    time.

Drop the second read of the loose object map in `repo_init()`.

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