diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2023-10-02 05:40:09 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-10-03 00:57:38 +0300 |
commit | 23b2c7e95b6f8f3045665835d2dc5028701eff18 (patch) | |
tree | ffc99ac1e4307004da2e31947e6806de3259319a /loose.h | |
parent | 15a1ca1abe8dafa9bf3bf924b4e3c6b851717ee2 (diff) |
loose: add a mapping between SHA-1 and SHA-256 for loose objects
As part of the transition plan, we'd like to add a file in the .git
directory that maps loose objects between SHA-1 and SHA-256. Let's
implement the specification in the transition plan and store this data
on a per-repository basis in struct repository.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'loose.h')
-rw-r--r-- | loose.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/loose.h b/loose.h new file mode 100644 index 0000000000..2c2957072c --- /dev/null +++ b/loose.h @@ -0,0 +1,22 @@ +#ifndef LOOSE_H +#define LOOSE_H + +#include "khash.h" + +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 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, + const struct object_id *compat_oid); +int repo_read_loose_object_map(struct repository *repo); +int repo_write_loose_object_map(struct repository *repo); + +#endif |