diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 20:56:38 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 20:56:38 +0900 |
commit | 8ab6f78d02f5b63837e6188c201e5fba28c7623d (patch) | |
tree | 5e1226fe530f35bb223a25ad06bed17fa5cd72a5 /org.eclipse.jgit.test/tst/org/eclipse/jgit/api | |
parent | 903f1d1639781fe18d867d4efb29b6213c6c8a97 (diff) | |
download | jgit-8ab6f78d02f5b63837e6188c201e5fba28c7623d.tar.gz jgit-8ab6f78d02f5b63837e6188c201e5fba28c7623d.zip |
CleanCommandTest: Open Repository in try-with-resource
Change-Id: If87cb729432ae711a2e7cfd08d288d7fec3f6de2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/api')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java index 3921c96cdc..065b5b4c3e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java +++ b/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)); |