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
This commit is contained in:
Dmitrii Filippov 2023-01-31 13:31:59 -05:00
parent eb3a708676
commit 0f3a3fde95
1 changed files with 10 additions and 1 deletions

View File

@ -66,7 +66,16 @@ public InMemoryRepository(DfsRepositoryDescription repoDesc) {
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} */