diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-05-07 06:53:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-07 07:50:50 +0200 |
commit | 781ba69d8bc1b0733eb502a2c247d5aebc2ef66d (patch) | |
tree | 506914921494984ea43da351769498b50d0a60b3 /oss-fuzz | |
parent | builtin/shortlog: don't set up revisions without repo (diff) | |
download | git-781ba69d8bc1b0733eb502a2c247d5aebc2ef66d.tar.xz git-781ba69d8bc1b0733eb502a2c247d5aebc2ef66d.zip |
oss-fuzz/commit-graph: set up hash algorithm
Our fuzzing setups don't work in a proper repository, but only use the
in-memory configured `the_repository`. Consequently, we never go through
the full repository setup procedures and thus do not set up the hash
algo used by the repository.
The commit-graph fuzzer does rely on a properly initialized hash algo
though. Initialize it explicitly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'oss-fuzz')
-rw-r--r-- | oss-fuzz/fuzz-commit-graph.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/oss-fuzz/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c index fe15e2c225..75e668a057 100644 --- a/oss-fuzz/fuzz-commit-graph.c +++ b/oss-fuzz/fuzz-commit-graph.c @@ -19,6 +19,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) * touching the disk to keep the individual fuzz-test cases as fast as * possible. */ + repo_set_hash_algo(the_repository, GIT_HASH_SHA1); the_repository->settings.commit_graph_generation_version = 2; the_repository->settings.commit_graph_read_changed_paths = 1; g = parse_commit_graph(&the_repository->settings, (void *)data, size); |