SshTestGitServer: : ensure UploadPack is closed to fix resource leak
Change-Id: Ib766f1d56b3ca7940c593ebfe0ac68fc5028a11c
This commit is contained in:
parent
bde09c185f
commit
396508e283
|
@ -480,13 +480,13 @@ protected GitUploadPackCommand(String command,
|
|||
|
||||
@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);
|
||||
|
|
Loading…
Reference in New Issue