git/oss-fuzz
Patrick Steinhardt f1141b4391 commit-graph: refactor `parse_commit_graph()` to take a repository
Refactor `parse_commit_graph()` so that it takes a repository instead of
taking repository settings. On the one hand this allows us to get rid of
instances where we access `the_hash_algo` by using the repository's hash
algorithm instead. On the other hand it also allows us to move the call
of `prepare_repo_settings()` into the function itself.

Note that there's one small catch, as the commit-graph fuzzer calls this
function directly without having a fully functional repository at hand.
And while the fuzzer already initializes `the_repository` with relevant
info, the call to `prepare_repo_settings()` would fail because we don't
have a fully-initialized repository.

Work around the issue by also settings `settings.initialized` to pretend
that we've already read the settings.

While at it, remove the redundant `parse_commit_graph()` declaration in
the fuzzer. It was added together with aa658574bf (commit-graph, fuzz:
add fuzzer for commit-graph, 2019-01-15), but as we also declared the
same function in "commit-graph.h" it wasn't ever needed.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-15 09:34:47 -07:00
..
.gitignore fuzz: port fuzz-url-decode-mem from OSS-Fuzz 2024-10-16 18:14:11 -04:00
dummy-cmd-main.c oss-fuzz: mark unused argv/argc argument 2024-08-17 09:46:11 -07:00
fuzz-commit-graph.c commit-graph: refactor `parse_commit_graph()` to take a repository 2025-08-15 09:34:47 -07:00
fuzz-config.c fuzz: add fuzzer for config parsing 2024-03-15 10:47:05 -07:00
fuzz-credential-from-url-gently.c fuzz: port fuzz-credential-from-url-gently from OSS-Fuzz 2024-10-16 18:14:11 -04:00
fuzz-date.c date: make DATE_MODE thread-safe 2024-04-05 15:21:14 -07:00
fuzz-pack-headers.c
fuzz-pack-idx.c object-store: rename files to "odb.{c,h}" 2025-07-01 14:46:34 -07:00
fuzz-parse-attr-line.c Merge branch 'ps/the-repository' 2025-01-21 08:44:54 -08:00
fuzz-url-decode-mem.c fuzz: port fuzz-url-decode-mem from OSS-Fuzz 2024-10-16 18:14:11 -04:00
meson.build meson: simplify use of the common-main library 2025-02-26 09:09:35 -08:00