summaryrefslogtreecommitdiffstats
path: root/oidset.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-14 08:50:42 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-14 19:26:34 +0200
commitf2c32a66f508586a9233dc6eac27bc4689e67dc1 (patch)
tree8a57762d12afdd00dba82baf70ad801d1be96a0c /oidset.h
parenthttp-fetch: don't crash when parsing packfile without a repo (diff)
downloadgit-f2c32a66f508586a9233dc6eac27bc4689e67dc1.tar.xz
git-f2c32a66f508586a9233dc6eac27bc4689e67dc1.zip
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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'oidset.h')
-rw-r--r--oidset.h4
1 files changed, 3 insertions, 1 deletions
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 {