diff options
author | Patrick Steinhardt <ps@pks.im> | 2021-08-09 10:11:59 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-09 09:51:12 -0700 |
commit | 809ea28f809e52d3204b597637b2f5e072c140f8 (patch) | |
tree | b80ce320ea84d371b686cfc331d4415f03bfe0d4 /t/t4133-apply-filenames.sh | |
parent | revision: stop retrieving reference twice (diff) | |
download | tgif-809ea28f809e52d3204b597637b2f5e072c140f8.tar.xz |
commit-graph: split out function to search commit position
The function `find_commit_in_graph()` assumes that the caller has passed
an object which was already determined to be a commit given that it will
access the commit's graph position, which is stored in a commit slab. In
a subsequent patch, we want to search for an object ID though without
knowing whether it is a commit or not, which is not currently possible.
Split out the logic to search the commit graph for a given object ID to
prepare for this change. This commit also renames the function to
`find_commit_pos_in_graph()`, which more accurately reflects what this
function does. Furthermore, in order to allow for the searched object ID
to be const, we need to adjust `bsearch_graph()`'s signature to accept a
constant object ID as input, too.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4133-apply-filenames.sh')
0 files changed, 0 insertions, 0 deletions