diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-06-14 08:50:42 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-14 19:26:34 +0200 |
commit | f2c32a66f508586a9233dc6eac27bc4689e67dc1 (patch) | |
tree | 8a57762d12afdd00dba82baf70ad801d1be96a0c /oidset.h | |
parent | http-fetch: don't crash when parsing packfile without a repo (diff) | |
download | git-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.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 { |