The function `repo_write_loose_object_map()` was introduced in
23b2c7e95b (loose: add a mapping between SHA-1 and SHA-256 for loose
objects, 2023-10-01), but it never had any callers as loose object maps
are instead written incrementally via `repo_add_loose_object_map()`
whenever a new loose object is created.
Besides being dead code, the function also hardcodes the location of the
"loose-object-idx" file as "$GIT_COMMON_DIR/objects", whereas both the
reader and `repo_add_loose_object_map()` derive the location from the
loose source's path. The function would thus disagree with everyone else
where the loose object map is supposed to be located when the object
directory is using a non-default location.
Remove the function.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
27 lines
745 B
C
27 lines
745 B
C
#ifndef LOOSE_H
|
|
#define LOOSE_H
|
|
|
|
#include "khash.h"
|
|
|
|
struct repository;
|
|
struct odb_source_loose;
|
|
|
|
struct loose_object_map {
|
|
kh_oid_map_t *to_compat;
|
|
kh_oid_map_t *to_storage;
|
|
};
|
|
|
|
void loose_object_map_init(struct loose_object_map **map);
|
|
void loose_object_map_clear(struct loose_object_map **map);
|
|
int loose_object_map_load(struct odb_source_loose *loose);
|
|
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 odb_source_loose *loose,
|
|
const struct object_id *oid,
|
|
const struct object_id *compat_oid);
|
|
int repo_read_loose_object_map(struct repository *repo);
|
|
|
|
#endif
|