aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
index 306c6c452c..09cd67b515 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
@@ -427,13 +427,8 @@ public class TransportSftp extends SshTransport implements WalkTransport {
private Ref readRef(final TreeMap<String, Ref> avail,
final String path, final String name) throws TransportException {
final String line;
- try {
- final BufferedReader br = openReader(path);
- try {
- line = br.readLine();
- } finally {
- br.close();
- }
+ try (BufferedReader br = openReader(path)) {
+ line = br.readLine();
} catch (FileNotFoundException noRef) {
return null;
} catch (IOException err) {