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
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
UploadPack uploadPack = new UploadPack(repository);
|
try (UploadPack uploadPack = new UploadPack(repository)) {
|
||||||
String gitProtocol = getEnvironment().getEnv().get("GIT_PROTOCOL");
|
String gitProtocol = getEnvironment().getEnv()
|
||||||
|
.get("GIT_PROTOCOL");
|
||||||
if (gitProtocol != null) {
|
if (gitProtocol != null) {
|
||||||
uploadPack
|
uploadPack.setExtraParameters(
|
||||||
.setExtraParameters(Collections.singleton(gitProtocol));
|
Collections.singleton(gitProtocol));
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
uploadPack.upload(getInputStream(), getOutputStream(),
|
uploadPack.upload(getInputStream(), getOutputStream(),
|
||||||
getErrorStream());
|
getErrorStream());
|
||||||
onExit(0);
|
onExit(0);
|
||||||
|
|
Loading…
Reference in New Issue