]> git.ipfire.org Git - thirdparty/git.git/blame - oss-fuzz/fuzz-commit-graph.c
Merge branch 'ks/ref-filter-signature'
[thirdparty/git.git] / oss-fuzz / fuzz-commit-graph.c
CommitLineData
8bff5ca0 1#include "git-compat-util.h"
aa658574 2#include "commit-graph.h"
249dc534 3#include "repository.h"
aa658574 4
a92d8523 5struct commit_graph *parse_commit_graph(struct repo_settings *s,
ab14d067 6 void *graph_map, size_t graph_size);
aa658574
JS
7
8int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
9
10int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
11{
12 struct commit_graph *g;
13
249dc534 14 initialize_the_repository();
a92d8523
TB
15 /*
16 * Initialize the_repository with commit-graph settings that would
17 * normally be read from the repository's gitdir. We want to avoid
18 * touching the disk to keep the individual fuzz-test cases as fast as
19 * possible.
20 */
21 the_repository->settings.commit_graph_generation_version = 2;
22 the_repository->settings.commit_graph_read_changed_paths = 1;
23 g = parse_commit_graph(&the_repository->settings, (void *)data, size);
249dc534 24 repo_clear(the_repository);
104de886 25 free_commit_graph(g);
aa658574
JS
26
27 return 0;
28}