diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-11-01 12:06:55 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-11-01 12:06:55 +0900 |
| commit | 922cc26e414f91d96f8c6c806c02962edb6158c9 (patch) | |
| tree | 1b835939e4ad7b8805c1b6142eec8677caac1026 /commit-graph.c | |
| parent | The twenty-first batch (diff) | |
| parent | commit: detect commits that exist in commit-graph but not in the ODB (diff) | |
| download | git-922cc26e414f91d96f8c6c806c02962edb6158c9.tar.gz git-922cc26e414f91d96f8c6c806c02962edb6158c9.zip | |
Merge branch 'ps/do-not-trust-commit-graph-blindly-for-existence' into kn/rev-list-missing-fix
* ps/do-not-trust-commit-graph-blindly-for-existence:
commit: detect commits that exist in commit-graph but not in the ODB
commit-graph: introduce envvar to disable commit existence checks
Diffstat (limited to 'commit-graph.c')
| -rw-r--r-- | commit-graph.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/commit-graph.c b/commit-graph.c index c2b782af3b..ee66098e07 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -1024,14 +1024,18 @@ int repo_find_commit_pos_in_graph(struct repository *r, struct commit *c, struct commit *lookup_commit_in_graph(struct repository *repo, const struct object_id *id) { + static int commit_graph_paranoia = -1; struct commit *commit; uint32_t pos; + if (commit_graph_paranoia == -1) + commit_graph_paranoia = git_env_bool(GIT_COMMIT_GRAPH_PARANOIA, 1); + if (!prepare_commit_graph(repo)) return NULL; if (!search_commit_pos_in_graph(id, repo->objects->commit_graph, &pos)) return NULL; - if (!has_object(repo, id, 0)) + if (commit_graph_paranoia && !has_object(repo, id, 0)) return NULL; commit = lookup_commit(repo, id); |
