aboutsummaryrefslogtreecommitdiff
path: root/packfile.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-20 08:07:39 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-20 13:16:42 -0700
commit6c2ede6e4abed754bb5891c2904212c05efcfb11 (patch)
tree84ad390cef9248deda96d8fca0dd290c2a69d23c /packfile.h
parentab3ab1038dd38d2be62e3bacf39a3248929a7a98 (diff)
downloadgit-6c2ede6e4abed754bb5891c2904212c05efcfb11.tar.xz
object-file: move logic to compute packed abbreviation length
Same as the preceding commit, move the logic that computes the minimum required prefix length to make a given object ID unique for the packfile store into a new function `packfile_store_find_abbrev_len()` that is part of "packfile.c". This prepares for making the logic fully generic via pluggable object databases. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.h')
-rw-r--r--packfile.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/packfile.h b/packfile.h
index fa41dfda38..45b35973f0 100644
--- a/packfile.h
+++ b/packfile.h
@@ -369,6 +369,11 @@ int packfile_store_for_each_object(struct packfile_store *store,
void *cb_data,
const struct odb_for_each_object_options *opts);
+int packfile_store_find_abbrev_len(struct packfile_store *store,
+ const struct object_id *oid,
+ unsigned min_len,
+ unsigned *out);
+
/* A hook to report invalid files in pack directory */
#define PACKDIR_FILE_PACK 1
#define PACKDIR_FILE_IDX 2