]> source.dussan.org Git - jgit.git/commit
reftable: fix seeking to refs in reflog implementation 87/146787/8
authorHan-Wen Nienhuys <hanwen@google.com>
Mon, 29 Jul 2019 08:58:50 +0000 (10:58 +0200)
committerHan-Wen Nienhuys <hanwen@google.com>
Mon, 19 Aug 2019 09:10:20 +0000 (11:10 +0200)
commitca9107d166ec2a06e8c16b73d05064ba28c049da
tree227905b468cdb664a8fda2fd19fb69ccf06e71ae
parent5e44bfa3ad462e1220426492c53606c6a643a970
reftable: fix seeking to refs in reflog implementation

Small reftables omit the log index. Currently,
ReftableWriter#shouldHaveIndex does this if there is a single-block
log, but other writers could decide on different criteria.

In the case that the log index is missing, we have to linearly search
for the right block. It is never appropriate to use binary search on
blocks for log data, as the blocks are compressed and therefore
irregularly sized.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: Id59874edf6bf45c7dec502d9465888e077ffe198
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftable/ReftableTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableReader.java