diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-17 06:56:34 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-16 22:16:15 -0700 |
| commit | 0f9b18935745fcdebcad613a6e3e52db5b29b1d4 (patch) | |
| tree | 321254d37ee0e0935d33f86c376361b0dc5a76de /loose.h | |
| parent | cbb388f3e53660c88220c40a8dddb976672ae03d (diff) | |
| download | git-0f9b18935745fcdebcad613a6e3e52db5b29b1d4.tar.gz | |
loose: write loose objects map via their source
When a repository is configured to have a compatibility hash algorithm
we keep track of object ID mappings for loose objects via the loose
object map. This map simply maps an object ID of the actual hash to the
object ID of the compatibility hash. This loose object map is an
inherent property of the loose files backend and thus of one specific
object source.
Refactor the interfaces to reflect this by requiring a `struct
odb_source` as input instead of a repository. This prepares for
subsequent commits where we will refactor writing of loose objects to
work on a `struct odb_source`, as well.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'loose.h')
| -rw-r--r-- | loose.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4,6 +4,7 @@ #include "khash.h" struct repository; +struct odb_source; struct loose_object_map { kh_oid_map_t *to_compat; @@ -16,7 +17,8 @@ int repo_loose_object_map_oid(struct repository *repo, const struct object_id *src, const struct git_hash_algo *dest_algo, struct object_id *dest); -int repo_add_loose_object_map(struct repository *repo, const struct object_id *oid, +int repo_add_loose_object_map(struct odb_source *source, + const struct object_id *oid, const struct object_id *compat_oid); int repo_read_loose_object_map(struct repository *repo); int repo_write_loose_object_map(struct repository *repo); |
