Browse Source

DirCacheCheckoutTest: Open TestRepository in try-with-resource

Change-Id: Iaf18ce230d6bf9b8bcb1895dd1bd3e4eb267de10
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago
parent
commit
7844b39966
  1. 4
      org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java

4
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());

Loading…
Cancel
Save