aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.ssh.jsch/src/org
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2020-11-03 23:33:19 +0100
committerThomas Wolf <thomas.wolf@paranor.ch>2020-11-03 23:50:21 +0100
commitd69fb4d4ac7bcf7d0d84109bba56cf944646fb24 (patch)
tree12a796e526b04e9207ef7f05b28d263154150053 /org.eclipse.jgit.ssh.jsch/src/org
parent5dcc46591aa1ad63f19e5240eff2cabe6bb9f306 (diff)
downloadjgit-d69fb4d4ac7bcf7d0d84109bba56cf944646fb24.tar.gz
jgit-d69fb4d4ac7bcf7d0d84109bba56cf944646fb24.zip
Revert "Client-side protocol V2 support for fetching"
This reverts commit f802f06e7fd5a98f256b7b7727598491f563bf2f. I had misunderstood how protocol V2 works. This implementation only works if the negotiation during fetch is done in one round. Fixing this is substantial work in BasePackFetchConnection. Basically I think I'd have to change back negotiate to the V0 version, and have a doFetch() that does if protocol V2 doFetchV2() else doFetchV0() with doFetchV0 the old code, and doFetchV2 completely new. Plus there would need to be a HTTP test case requiring several negotiation rounds. This is a couple of days work at least, and I don't know when I will have the time to revisit this. So although the rest of the code is fine I prefer to back this out completely and not leave a only half working implementation in the code for an indeterminate time. Bug: 553083 Change-Id: Icbbbb09882b3b83f9897deac4a06d5f8dc99d84e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.ssh.jsch/src/org')
-rw-r--r--org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java25
1 files changed, 4 insertions, 21 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 c7d0941b62..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
@@ -22,9 +22,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
@@ -46,7 +44,7 @@ import com.jcraft.jsch.SftpException;
* {@link org.eclipse.jgit.transport.JschConfigSessionFactory} is used to create
* the actual session passed to the constructor.
*/
-public class JschSession implements RemoteSession2 {
+public class JschSession implements RemoteSession {
final Session sock;
final URIish uri;
@@ -67,14 +65,7 @@ public class JschSession implements RemoteSession2 {
/** {@inheritDoc} */
@Override
public Process exec(String command, int timeout) throws IOException {
- return exec(command, Collections.emptyMap(), timeout);
- }
-
- /** {@inheritDoc} */
- @Override
- public Process exec(String command, Map<String, String> environment,
- int timeout) throws IOException {
- return new JschProcess(command, environment, timeout);
+ return new JschProcess(command, timeout);
}
/** {@inheritDoc} */
@@ -133,8 +124,6 @@ public class JschSession implements RemoteSession2 {
*
* @param commandName
* the command to execute
- * @param environment
- * environment variables to pass on
* @param tms
* the timeout value, in seconds, for the command.
* @throws TransportException
@@ -143,17 +132,11 @@ public class JschSession implements RemoteSession2 {
* @throws IOException
* on problems opening streams
*/
- JschProcess(String commandName, Map<String, String> environment,
- int tms) throws TransportException, IOException {
+ JschProcess(String commandName, int tms)
+ throws TransportException, IOException {
timeout = tms;
try {
channel = (ChannelExec) sock.openChannel("exec"); //$NON-NLS-1$
- if (environment != null) {
- for (Map.Entry<String, String> envVar : environment
- .entrySet()) {
- channel.setEnv(envVar.getKey(), envVar.getValue());
- }
- }
channel.setCommand(commandName);
setupStreams();
channel.connect(timeout > 0 ? timeout * 1000 : 0);