Repository wasn't closed in FetchAndPullCommandsRecurseSubmodulesTest.
This caused a "Resource leak: 'g' is never closed" warning during
compilation.
Bug: 578546
Change-Id: I591ef1e286bcd9a7103c016fd47015e77fa95cbb
// the commit that was created
try (SubmoduleWalk w = SubmoduleWalk.forIndex(git.getRepository())) {
assertTrue(w.next());
- try (Repository repository = w.getRepository()) {
- Git g = new Git(repository);
+ try (Repository repository = w.getRepository();
+ Git g = new Git(repository)) {
g.fetch().setRemote(REMOTE).setRefSpecs(REFSPEC).call();
g.reset().setMode(ResetType.HARD).setRef(commit1.name()).call();
}