From 7cd5d77ae37ad7febb6d6e7410da4e7b35348fce Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Sat, 12 Aug 2017 14:31:16 -0700 Subject: dfs: Switch InMemoryRepository to DfsReftableDatabase This ensure DfsReftableDatabase is tested by the same test suites that use/test InMemoryRepository. It also simplifies the logic of InMemoryRepository and brings its compatibility story closer to any other DFS repository that uses reftables for its reference storage. Change-Id: I881469fd77ed11a9239b477633510b8c482a19ca Signed-off-by: Minh Thai Signed-off-by: Terry Parker --- .../eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test') diff --git a/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java b/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java index a1e41d12d5..6174258c67 100644 --- a/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java +++ b/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java @@ -46,6 +46,7 @@ import java.io.IOException; import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository; +import org.eclipse.jgit.internal.storage.reftable.Reftable; import org.eclipse.jgit.lib.RefDatabase; /** @@ -80,14 +81,12 @@ class RefsUnreadableInMemoryRepository extends InMemoryRepository { } private class RefsUnreadableRefDatabase extends MemRefDatabase { - @Override - protected RefCache scanAllRefs() throws IOException { + protected Reftable reader() throws IOException { if (failing) { throw new IOException("disk failed, no refs found"); - } else { - return super.scanAllRefs(); } + return super.reader(); } } } -- cgit v1.2.3