]> Kevux Git Server - rit/commit
repository: stop reading loose object map twice on repo init
authorPatrick Steinhardt <ps@pks.im>
Thu, 4 Jun 2026 07:46:31 +0000 (09:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Jun 2026 12:49:39 +0000 (21:49 +0900)
commita84a9d4acdae51f58529b2596c4bd935fe9af372
treed907d7e64fde2722d74600f2d5d45d369193c52d
parentd87de311ff506599ec130ba5f09a4f73e458a5ae
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