TestRepository: Fix resource leak flagged by Eclipse
Since [1], included in JGit 5.3.0, TestRepository is AutoCloseable and should be managed by try-with-resource. [1] https://git.eclipse.org/r/#/c/134912 Change-Id: Id5fa8a47e1557ee2a5765aa13fc317f2f73ef5d1
This commit is contained in:
committed by
David Pursehouse
parent
9cbb372690
commit
3b2df0674b
@@ -106,8 +106,8 @@ public class TestChanges {
|
||||
// Change doesn't exist yet. NoteDb requires that there be a commit for the
|
||||
// first patch set, so create one.
|
||||
GitRepositoryManager repoManager = injector.getInstance(GitRepositoryManager.class);
|
||||
try (Repository repo = repoManager.openRepository(c.getProject())) {
|
||||
TestRepository<Repository> tr = new TestRepository<>(repo);
|
||||
try (Repository repo = repoManager.openRepository(c.getProject());
|
||||
TestRepository<Repository> tr = new TestRepository<>(repo)) {
|
||||
PersonIdent ident =
|
||||
user.asIdentifiedUser().newCommitterIdent(update.getWhen(), TimeZone.getDefault());
|
||||
TestRepository<Repository>.CommitBuilder cb =
|
||||
|
||||
Reference in New Issue
Block a user