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