]> source.dussan.org Git - jgit.git/commitdiff
CleanCommandTest: Open Repository in try-with-resource 67/118667/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 5 Mar 2018 11:56:38 +0000 (20:56 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 5 Mar 2018 11:56:38 +0000 (20:56 +0900)
Change-Id: If87cb729432ae711a2e7cfd08d288d7fec3f6de2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java

index 3921c96cdc79839622df4bb218c7a54e13ca2a2f..065b5b4c3e6f39b8147fb4577b8e079d2c8e13b4 100644 (file)
@@ -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));