From f2c32a66f508586a9233dc6eac27bc4689e67dc1 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 14 Jun 2024 08:50:42 +0200 Subject: oidset: pass hash algorithm when parsing file The `oidset_parse_file_carefully()` function implicitly depends on `the_repository` when parsing object IDs. Fix this by having callers pass in the hash algorithm to use. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- oidset.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'oidset.h') diff --git a/oidset.h b/oidset.h index 262f4256d6..0106b6f278 100644 --- a/oidset.h +++ b/oidset.h @@ -80,7 +80,8 @@ void oidset_clear(struct oidset *set); * are allowed. Leading whitespace and empty or white-space only lines are * ignored. */ -void oidset_parse_file(struct oidset *set, const char *path); +void oidset_parse_file(struct oidset *set, const char *path, + const struct git_hash_algo *algop); /* * Similar to the above, but with a callback which can (1) return non-zero to @@ -89,6 +90,7 @@ void oidset_parse_file(struct oidset *set, const char *path); */ typedef int (*oidset_parse_tweak_fn)(struct object_id *, void *); void oidset_parse_file_carefully(struct oidset *set, const char *path, + const struct git_hash_algo *algop, oidset_parse_tweak_fn fn, void *cbdata); struct oidset_iter { -- cgit v1.3-6-g1900