diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2020-08-06 23:43:40 +0200 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2020-08-10 22:51:34 +0200 |
commit | 24fdc1d039dd075a54d0db36b63bf8aba4919068 (patch) | |
tree | 721560429b0c2ace151e11eb1b6abf92e132c148 /org.eclipse.jgit.ssh.jsch | |
parent | cc9975ff68158a602fde8fb1c396e164081262ab (diff) | |
download | jgit-24fdc1d039dd075a54d0db36b63bf8aba4919068.tar.gz jgit-24fdc1d039dd075a54d0db36b63bf8aba4919068.zip |
Fix JSchProcess.waitFor() with time-out
SshSupport.runSshCommand() had a comment that wait with time-out
could not be used because JSchProcess.exitValue() threw the wrong
unchecked exception when the process was still running.
Fix this and make JSchProcess.exitValue() throw the right exception,
then wait with a time-out in SshSupport.
The Apache sshd client's SshdExecProcess has always used the correct
IllegalThreadStateException.
Add tests for SshSupport.runCommand().
Change-Id: Id30893174ae8be3b9a16119674049337b0cf4381
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.ssh.jsch')
-rw-r--r-- | org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java index 300e03d798..858bdf3f7f 100644 --- a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java +++ b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java @@ -198,7 +198,7 @@ public class JschSession implements RemoteSession { @Override public int exitValue() { if (isRunning()) - throw new IllegalStateException(); + throw new IllegalThreadStateException(); return channel.getExitStatus(); } |