diff options
author | Dmitrii Filippov <dmfilippov@google.com> | 2023-01-31 13:31:59 -0500 |
---|---|---|
committer | Dmitrii Filippov <dmfilippov@google.com> | 2023-01-31 13:55:25 -0500 |
commit | 0f3a3fde95b59f4832c3ad4234f7c3f00e06e7a4 (patch) | |
tree | 4f3073ce28062ba7f9407d63009df1367d8aef47 /org.eclipse.jgit | |
parent | eb3a708676e3487bbd97df384c09595034034d7e (diff) | |
download | jgit-0f3a3fde95b59f4832c3ad4234f7c3f00e06e7a4.tar.gz jgit-0f3a3fde95b59f4832c3ad4234f7c3f00e06e7a4.zip |
Move MemRefDatabase creation in a separate method.
The InMemoryRepository is used in tests (e.g. in gerrit tests) and it
can be useful to create a custom MemRefDatabase for some tests.
Change-Id: I6fbbbfe04400ea1edc988c8788c8eeb06ca8480a
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java index 5a8207ed01..583b8b3f6b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java @@ -66,7 +66,16 @@ public class InMemoryRepository extends DfsRepository { InMemoryRepository(Builder builder) { super(builder); objdb = new MemObjDatabase(this); - refdb = new MemRefDatabase(); + refdb = createRefDatabase(); + } + + /** + * Creates a new in-memory ref database. + * + * @return a new in-memory reference database. + */ + protected MemRefDatabase createRefDatabase() { + return new MemRefDatabase(); } /** {@inheritDoc} */ |