Browse Source

CleanCommandTest: Open Repository in try-with-resource

Change-Id: If87cb729432ae711a2e7cfd08d288d7fec3f6de2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago
parent
commit
8ab6f78d02
  1. 5
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java

5
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java

@ -240,8 +240,9 @@ public class CleanCommandTest extends RepositoryTestCase {
command.setPath(path);
String uri = db.getDirectory().toURI().toString();
command.setURI(uri);
Repository repo = command.call();
repo.close();
try (Repository repo = command.call()) {
// Unused
}
Status beforeCleanStatus = git.status().call();
assertTrue(beforeCleanStatus.getAdded().contains(DOT_GIT_MODULES));

Loading…
Cancel
Save