Browse Source

CommitCommandTest: Open Repository in try-with-resource

Change-Id: Id9961a120ef9f949f04fc95455fae06ba95d8031
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago
parent
commit
06fbd7c5fa
  1. 12
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java

12
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java

@ -223,9 +223,9 @@ public class CommitCommandTest extends RepositoryTestCase {
assertEquals(uri, generator.getModulesUrl());
assertEquals(path, generator.getModulesPath());
assertEquals(uri, generator.getConfigUrl());
Repository subModRepo = generator.getRepository();
assertNotNull(subModRepo);
subModRepo.close();
try (Repository subModRepo = generator.getRepository()) {
assertNotNull(subModRepo);
}
assertEquals(commit, repo.resolve(Constants.HEAD));
RevCommit submoduleCommit = git.commit().setMessage("submodule add")
@ -273,9 +273,9 @@ public class CommitCommandTest extends RepositoryTestCase {
assertEquals(uri, generator.getModulesUrl());
assertEquals(path, generator.getModulesPath());
assertEquals(uri, generator.getConfigUrl());
Repository subModRepo = generator.getRepository();
assertNotNull(subModRepo);
subModRepo.close();
try (Repository subModRepo = generator.getRepository()) {
assertNotNull(subModRepo);
}
assertEquals(commit2, repo.resolve(Constants.HEAD));
RevCommit submoduleAddCommit = git.commit().setMessage("submodule add")

Loading…
Cancel
Save