aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2019-01-20 14:54:14 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2019-01-20 14:55:47 +0900
commit7844b399666824427201c98b64dbc653a4c5301e (patch)
tree62575ad9694288cedffc0440e02fec9941689709 /org.eclipse.jgit.test
parentb4656572388015dad6b968e41f767d4e8a414525 (diff)
downloadjgit-7844b399666824427201c98b64dbc653a4c5301e.tar.gz
jgit-7844b399666824427201c98b64dbc653a4c5301e.zip
DirCacheCheckoutTest: Open TestRepository in try-with-resource
Change-Id: Iaf18ce230d6bf9b8bcb1895dd1bd3e4eb267de10 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
index 534b323fe6..483051ceeb 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
@@ -267,10 +267,10 @@ public class DirCacheCheckoutTest extends RepositoryTestCase {
public void testInitialCheckout() throws Exception {
ChangeRecorder recorder = new ChangeRecorder();
ListenerHandle handle = null;
- try (Git git = new Git(db)) {
+ try (Git git = new Git(db);
+ TestRepository<Repository> db_t = new TestRepository<>(db)) {
handle = db.getListenerList()
.addWorkingTreeModifiedListener(recorder);
- TestRepository<Repository> db_t = new TestRepository<>(db);
BranchBuilder master = db_t.branch("master");
master.commit().add("f", "1").message("m0").create();
assertFalse(new File(db.getWorkTree(), "f").exists());