]> source.dussan.org Git - jgit.git/commitdiff
ssh: Kill the external process when we're done instead of waiting forever 02/115802/7
authorCarsten Pfeiffer <carsten.pfeiffer@gebit.de>
Wed, 2 May 2018 15:40:30 +0000 (17:40 +0200)
committerCarsten Pfeiffer <carsten.pfeiffer@gebit.de>
Wed, 2 May 2018 15:41:39 +0000 (17:41 +0200)
Bug: 529463
Change-Id: Iaf6fe20a1c759ac5e91a2393d7bc40a94f859e84
Signed-off-by: Carsten Pfeiffer <carsten.pfeiffer@gebit.de>
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java

index bc85e6f60f5f4529734cfd957c6cde5794ae4cae..291b536184a984a77a086f420622f9884787d81d 100644 (file)
@@ -311,6 +311,9 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
                public void close() {
                        endOut();
 
+                       if (process != null) {
+                               process.destroy();
+                       }
                        if (errorThread != null) {
                                try {
                                        errorThread.halt();
@@ -322,8 +325,6 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
                        }
 
                        super.close();
-                       if (process != null)
-                               process.destroy();
                }
        }
 
@@ -377,6 +378,9 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
                public void close() {
                        endOut();
 
+                       if (process != null) {
+                               process.destroy();
+                       }
                        if (errorThread != null) {
                                try {
                                        errorThread.halt();
@@ -388,8 +392,6 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
                        }
 
                        super.close();
-                       if (process != null)
-                               process.destroy();
                }
        }
 }