diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2019-10-16 17:49:52 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-10-16 18:45:34 -0400 |
commit | 762f6212b4692b28f098ac597058bd6a489b8b49 (patch) | |
tree | ec660e607f5c263fb8d55ee36a8886ab08050232 /org.eclipse.jgit.test/tst/org/eclipse/jgit/api | |
parent | 88bd90149230fac855e72b3cbdc8bbbe2730281f (diff) | |
download | jgit-762f6212b4692b28f098ac597058bd6a489b8b49.tar.gz jgit-762f6212b4692b28f098ac597058bd6a489b8b49.zip |
Close RevWalks in tests
Change-Id: Id28804ace2572e8f659271660e78454a0d6ccc49
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/api')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java index 4401bcedb3..1b2c850192 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java @@ -2136,10 +2136,12 @@ public class RebaseCommandTest extends RepositoryTestCase { private List<DiffEntry> getStashedDiff() throws AmbiguousObjectException, IncorrectObjectTypeException, IOException, MissingObjectException { ObjectId stashId = db.resolve("stash@{0}"); - RevWalk revWalk = new RevWalk(db); - RevCommit stashCommit = revWalk.parseCommit(stashId); - List<DiffEntry> diffs = diffWorkingAgainstHead(stashCommit, revWalk); - return diffs; + try (RevWalk revWalk = new RevWalk(db)) { + RevCommit stashCommit = revWalk.parseCommit(stashId); + List<DiffEntry> diffs = diffWorkingAgainstHead(stashCommit, + revWalk); + return diffs; + } } private TreeWalk createTreeWalk() { |