use of org.eclipse.jgit.internal.storage.dfs.InMemoryRepository in project gerrit by GerritCodeReview.
the class NoteDbUpdateManagerTest method newBatchRefUpdate.
@SafeVarargs
private static BatchRefUpdate newBatchRefUpdate(Consumer<ReceiveCommand>... resultSetters) {
try (Repository repo = new InMemoryRepository(new DfsRepositoryDescription("repo"))) {
BatchRefUpdate bru = repo.getRefDatabase().newBatchUpdate();
for (int i = 0; i < resultSetters.length; i++) {
ReceiveCommand cmd = new ReceiveCommand(ObjectId.fromString(String.format("%039x1", i)), ObjectId.fromString(String.format("%039x2", i)), "refs/heads/branch" + i);
bru.addCommand(cmd);
resultSetters[i].accept(cmd);
}
return bru;
}
}
use of org.eclipse.jgit.internal.storage.dfs.InMemoryRepository in project gitiles by GerritCodeReview.
the class ServletTest method setUp.
@Before
public void setUp() throws Exception {
MockSystemReader mockSystemReader = new MockSystemReader();
SystemReader.setInstance(mockSystemReader);
DfsRepository r = new InMemoryRepository(new DfsRepositoryDescription("repo"));
repo = new TestRepository<>(r, new RevWalk(r), mockSystemReader);
servlet = TestGitilesServlet.create(repo);
}
use of org.eclipse.jgit.internal.storage.dfs.InMemoryRepository in project gitiles by GerritCodeReview.
the class TimeCacheTest method setUp.
@Before
public void setUp() throws Exception {
repo = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription("test")));
walk = new RevWalk(repo.getRepository());
cache = new TimeCache();
start = repo.getDate().getTime() / 1000;
}
use of org.eclipse.jgit.internal.storage.dfs.InMemoryRepository in project gitiles by GerritCodeReview.
the class HostIndexServletTest method setUp.
@Override
@Before
public void setUp() throws Exception {
repo = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription(NAME)));
servlet = TestGitilesServlet.create(repo);
}
Aggregations