mirror of
https://github.com/git/git
synced 2024-11-04 16:17:49 +00:00
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>
This commit is contained in:
parent
373bfa6077
commit
781ba69d8b
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue