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. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java

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

Loading…
Cancel
Save