summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-04-03 08:04:18 +0200
committerJunio C Hamano <gitster@pobox.com>2024-04-03 09:16:50 -0700
commitf9e88544f5488adf07fd9c217ab6ab8f433a1ce8 (patch)
tree5993eb2293368b253893d4e3764c45ddc3a95835 /builtin/commit.c
parent77307a61d6d6f17dcbf7534c512af370185a4391 (diff)
reftable/block: fix error handling when searching restart points
When doing the binary search over restart points in a block we need to decode the record keys. This decoding step can result in an error when the block is corrupted, which we indicate to the caller of the binary search by setting `args.error = 1`. But the only caller that exists mishandles this because it in fact performs the error check before calling `binsearch()`. Fix this bug by checking for errors at the right point in time. Furthermore, refactor `binsearch()` so that it aborts the search in case the callback function returns a negative value so that we don't needlessly continue to search the block. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions