]> git.ipfire.org Git - thirdparty/git.git/commit
commit-graph: introduce `repo_find_commit_pos_in_graph()`
authorTaylor Blau <me@ttaylorr.com>
Tue, 12 Jul 2022 23:10:31 +0000 (19:10 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Jul 2022 23:51:39 +0000 (16:51 -0700)
commit7805360b7a3be02057385bc9d17aa493120b9538
tree6074401cd0c391f008ea3e9983de47cf87403a10
parent2dd804cd12143741ea4188346fba250e821609b5
commit-graph: introduce `repo_find_commit_pos_in_graph()`

Low-level callers in systems that are adjacent to the commit-graph (like
the changed-path Bloom filter code) could benefit from being able to
call a function like `parse_commit_in_graph()` without modifying the
corresponding commit slab data.

This is useful in contexts where that slab data is being used to prepare
for an upcoming commit-graph write, where Git must be careful to avoid
clobbering any of that data during a read operation.

Introduce a low-level variant of `parse_commit_in_graph()` which returns
the graph position of a given commit only, without modifying any of the
slab data.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c
commit-graph.h