]> source.dussan.org Git - jgit.git/commitdiff
DiffAlgorithms: Open Repository in try-with-resource 33/118733/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 6 Mar 2018 00:52:12 +0000 (09:52 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 6 Mar 2018 00:52:12 +0000 (09:52 +0900)
Change-Id: I67cb486283213f8aa964333533c55966518baa36
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java

index 5f8ebdb1a9b0a6a5ffd898db0be56176736053da..0e1b398a738c5cff6651c3783b5563dec4208708 100644 (file)
@@ -160,11 +160,8 @@ class DiffAlgorithms extends TextBuiltin {
                        else
                                rb.findGitDir(dir);
 
-                       Repository repo = rb.build();
-                       try {
+                       try (Repository repo = rb.build()) {
                                run(repo);
-                       } finally {
-                               repo.close();
                        }
                }
        }