diff options
Diffstat (limited to 'org.eclipse.jgit.junit.ssh/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java b/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java index 4fe98f8683..5d043ffc3a 100644 --- a/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java +++ b/org.eclipse.jgit.junit.ssh/src/org/eclipse/jgit/junit/ssh/SshTestGitServer.java @@ -480,13 +480,13 @@ public class SshTestGitServer { @Override public void run() { - UploadPack uploadPack = new UploadPack(repository); - String gitProtocol = getEnvironment().getEnv().get("GIT_PROTOCOL"); - if (gitProtocol != null) { - uploadPack - .setExtraParameters(Collections.singleton(gitProtocol)); - } - try { + try (UploadPack uploadPack = new UploadPack(repository)) { + String gitProtocol = getEnvironment().getEnv() + .get("GIT_PROTOCOL"); + if (gitProtocol != null) { + uploadPack.setExtraParameters( + Collections.singleton(gitProtocol)); + } uploadPack.upload(getInputStream(), getOutputStream(), getErrorStream()); onExit(0); |