The ninth batch
[alt-git.git] / oss-fuzz / fuzz-commit-graph.c
blob75e668a057ca40a2d4daa36db0a5a9e04ca42b85
1 #include "git-compat-util.h"
2 #include "commit-graph.h"
3 #include "repository.h"
5 struct commit_graph *parse_commit_graph(struct repo_settings *s,
6 void *graph_map, size_t graph_size);
8 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
10 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
12 struct commit_graph *g;
14 initialize_repository(the_repository);
17 * Initialize the_repository with commit-graph settings that would
18 * normally be read from the repository's gitdir. We want to avoid
19 * touching the disk to keep the individual fuzz-test cases as fast as
20 * possible.
22 repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
23 the_repository->settings.commit_graph_generation_version = 2;
24 the_repository->settings.commit_graph_read_changed_paths = 1;
25 g = parse_commit_graph(&the_repository->settings, (void *)data, size);
26 repo_clear(the_repository);
27 free_commit_graph(g);
29 return 0;