diff options
author | Anna Papitto <annapapitto@google.com> | 2023-05-30 16:20:54 +0200 |
---|---|---|
committer | Anna Papitto <annapapitto@google.com> | 2023-05-31 10:09:50 +0200 |
commit | 74547f4a68c444b495af014dcfc07df3e09bbc36 (patch) | |
tree | 832a8161a06a5a5bed538c126317fa9a9c75c709 /org.eclipse.jgit.test | |
parent | 181b629f7deea1750b8e5d2160750ed2cef91c3d (diff) | |
download | jgit-74547f4a68c444b495af014dcfc07df3e09bbc36.tar.gz jgit-74547f4a68c444b495af014dcfc07df3e09bbc36.zip |
PackReverseIndex: use static builder instead of constructor
PackReverseIndex instances are created using the constructor directly,
which limits control over the construction logic and refactoring
opportunities for the class itself. These will be needed for a
file-based implementation of the reverse index.
Use a static builder method to create a PackReverseIndex instance using
a pack's forward index.
Change-Id: I4421d907cd61d9ac932df5377e5e28a81679b63f
Signed-off-by: Anna Papitto <annapapitto@google.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java index 292e3e758a..cd37c354a5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java @@ -37,9 +37,8 @@ public class PackReverseIndexTest extends RepositoryTestCase { public void setUp() throws Exception { super.setUp(); // index with both small (< 2^31) and big offsets - idx = PackIndex.open(JGitTestUtil.getTestResourceFile( - "pack-huge.idx")); - reverseIdx = new PackReverseIndex(idx); + idx = PackIndex.open(JGitTestUtil.getTestResourceFile("pack-huge.idx")); + reverseIdx = PackReverseIndex.computeFromIndex(idx); } /** |