Port IJPL-156591 to 243 (solves IJPL-171891)

Original MR to master: https://code.jetbrains.team/p/ij/repositories/ultimate/reviews/147074/timeline

Merge-request: IJ-MR-150150
Merged-by: Sergey Pak <Sergey.Pak@jetbrains.com>

GitOrigin-RevId: b333a198101a5c624b60033a3965d0458ad75177
This commit is contained in:
Sergey Pak
2024-11-26 17:30:10 +00:00
committed by intellij-monorepo-bot
parent c45fbf5a97
commit 9bad0dcd78
5 changed files with 71 additions and 19 deletions

View File

@@ -75,7 +75,6 @@ junit-vintage-engine.version=5.10.0
junit-jupiter-engine.version=5.10.0
# Only used for internal tests in Ant project
junit-jupiter-params.version=${junit-jupiter-engine.version}
jsch.version=0.1.55
jython.version=2.7.3
# log4j 1.2.15 requires JMS and a few other Sun jars that are not in the m2 repo
log4j.version=1.2.14

View File

@@ -633,6 +633,14 @@ object CommunityLibraryLicenses {
.license("Eclipse Distribution License 1.0", "https://www.eclipse.org/org/documents/edl-v10.php")
.suppliedByOrganizations(Suppliers.ECLIPSE),
LibraryLicense("JGit SSH Apache", libraryName = "eclipse.jgit.ssh.apache", url = "https://www.eclipse.org/jgit/")
.license("Eclipse Distribution License 1.0", "https://www.eclipse.org/org/documents/edl-v10.php")
.suppliedByOrganizations(Suppliers.ECLIPSE),
LibraryLicense("JGit SSH Apache Agent", libraryName = "eclipse.jgit.ssh.apache.agent", url = "https://www.eclipse.org/jgit/")
.license("Eclipse Distribution License 1.0", "https://www.eclipse.org/org/documents/edl-v10.php")
.suppliedByOrganizations(Suppliers.ECLIPSE),
LibraryLicense("JGoodies Common", libraryName = "jgoodies-common", url = "https://www.jgoodies.com/freeware/libraries/looks/")
.newBsd("https://opensource.org/licenses/BSD-3-Clause"), // no longer OSS; historic versions are still available
@@ -665,10 +673,6 @@ object CommunityLibraryLicenses {
LibraryLicense("jps-javac-extension", libraryName = "jps-javac-extension", url = "https://github.com/JetBrains/jps-javac-extension/")
.apache("https://github.com/JetBrains/jps-javac-extension/blob/master/LICENSE.txt"),
LibraryLicense("jsch", libraryName = "eclipse.jgit.ssh.jsch", url = "http://www.jcraft.com/jsch/")
.newBsd("http://www.jcraft.com/jsch/LICENSE.txt")
.suppliedByPersons("Atsuhiko Yamanaka"),
LibraryLicense(libraryName = "jsch-agent-proxy", url = "https://github.com/ymnk/jsch-agent-proxy")
.newBsd("https://github.com/ymnk/jsch-agent-proxy/blob/master/LICENSE.txt")
.suppliedByPersons("Atsuhiko Yamanaka"),

View File

@@ -12,22 +12,60 @@
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
<orderEntry type="library" exported="" name="jetbrains.intellij.deps.eclipse.jgit" level="project" />
<orderEntry type="module-library" exported="">
<library name="eclipse.jgit.ssh.jsch" type="repository">
<properties include-transitive-deps="false" maven-id="org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:6.5.0.202303070854-r">
<library name="eclipse.jgit.ssh.apache.agent" type="repository">
<properties include-transitive-deps="false" maven-id="org.eclipse.jgit:org.eclipse.jgit.ssh.apache.agent:6.6.1.202309021850-r">
<verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/6.5.0.202303070854-r/org.eclipse.jgit.ssh.jsch-6.5.0.202303070854-r.jar">
<sha256sum>8ab7b5fefc2a42c5156c678148f415ce35ae8d93a8e3127b5426241e965606f6</sha256sum>
<artifact url="file://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache.agent/6.6.1.202309021850-r/org.eclipse.jgit.ssh.apache.agent-6.6.1.202309021850-r.jar">
<sha256sum>4ddd0cf1a7ece350b33f0a6b865e8fb777c30a2282a0fbd1754020a4e06af481</sha256sum>
</artifact>
</verification>
</properties>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/6.5.0.202303070854-r/org.eclipse.jgit.ssh.jsch-6.5.0.202303070854-r.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache.agent/6.6.1.202309021850-r/org.eclipse.jgit.ssh.apache.agent-6.6.1.202309021850-r.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/6.5.0.202303070854-r/org.eclipse.jgit.ssh.jsch-6.5.0.202303070854-r-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache.agent/6.6.1.202309021850-r/org.eclipse.jgit.ssh.apache.agent-6.6.1.202309021850-r-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/6.5.0.202303070854-r/org.eclipse.jgit.ssh.jsch-6.5.0.202303070854-r-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache.agent/6.6.1.202309021850-r/org.eclipse.jgit.ssh.apache.agent-6.6.1.202309021850-r-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library name="eclipse.jgit.ssh.apache" type="repository">
<properties include-transitive-deps="false" maven-id="org.eclipse.jgit:org.eclipse.jgit.ssh.apache:6.6.1.202309021850-r">
<verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache/6.6.1.202309021850-r/org.eclipse.jgit.ssh.apache-6.6.1.202309021850-r.jar">
<sha256sum>cc379265edb2b74850156c16fefd7990281bf47e33fe7665e838f8b5fdb94755</sha256sum>
</artifact>
</verification>
</properties>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache/6.6.1.202309021850-r/org.eclipse.jgit.ssh.apache-6.6.1.202309021850-r.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache/6.6.1.202309021850-r/org.eclipse.jgit.ssh.apache-6.6.1.202309021850-r-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache/6.6.1.202309021850-r/org.eclipse.jgit.ssh.apache-6.6.1.202309021850-r-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library name="apache.sshd.osgi" type="repository">
<properties include-transitive-deps="false" maven-id="org.apache.sshd:sshd-osgi:2.13.2">
<verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/apache/sshd/sshd-osgi/2.13.2/sshd-osgi-2.13.2.jar">
<sha256sum>65a0f1df8616ae371f19d000514afda9730089ddb7e6b7a03e96adfa17f6bccb</sha256sum>
</artifact>
</verification>
</properties>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/sshd/sshd-osgi/2.13.2/sshd-osgi-2.13.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/sshd/sshd-osgi/2.13.2/sshd-osgi-2.13.2-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>

View File

@@ -8,5 +8,9 @@
modules:
- name: intellij.settingsRepository
libraries:
eclipse.jgit.ssh.jsch:
- name: $MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/6/org.eclipse.jgit.ssh.jsch-6.jar
eclipse.jgit.ssh.apache.agent:
- name: $MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache.agent/6/org.eclipse.jgit.ssh.apache.agent-6.jar
eclipse.jgit.ssh.apache:
- name: $MAVEN_REPOSITORY$/org/eclipse/jgit/org.eclipse.jgit.ssh.apache/6/org.eclipse.jgit.ssh.apache-6.jar
apache.sshd.osgi:
- name: $MAVEN_REPOSITORY$/org/apache/sshd/sshd-osgi/2/sshd-osgi-2.jar

View File

@@ -13,6 +13,7 @@ import org.eclipse.jgit.api.ResetCommand
import org.eclipse.jgit.dircache.DirCacheCheckout
import org.eclipse.jgit.errors.TransportException
import org.eclipse.jgit.internal.JGitText
import org.eclipse.jgit.internal.transport.sshd.agent.ConnectorFactoryProvider
import org.eclipse.jgit.lib.*
import org.eclipse.jgit.revwalk.RevCommit
import org.eclipse.jgit.revwalk.RevSort
@@ -24,7 +25,8 @@ import org.eclipse.jgit.transport.FetchResult
import org.eclipse.jgit.transport.RemoteConfig
import org.eclipse.jgit.transport.Transport
import org.eclipse.jgit.transport.SshSessionFactory
import org.eclipse.jgit.transport.ssh.jsch.JschConfigSessionFactory
import org.eclipse.jgit.transport.sshd.SshdSessionFactory
import org.eclipse.jgit.transport.sshd.agent.ConnectorFactory
import org.eclipse.jgit.treewalk.FileTreeIterator
import org.eclipse.jgit.treewalk.TreeWalk
import org.jetbrains.annotations.NonNls
@@ -58,10 +60,15 @@ private fun isAuthFailedMessage(message: String): Boolean {
}
private fun ensureSshSessionFactory() {
var instance = SshSessionFactory.getInstance()
if (instance == null) {
instance = JschConfigSessionFactory()
SshSessionFactory.setInstance(instance)
var connectorFactoryInstance: ConnectorFactory? = ConnectorFactoryProvider.getDefaultFactory()
if (connectorFactoryInstance == null) {
connectorFactoryInstance = org.eclipse.jgit.internal.transport.sshd.agent.connector.Factory()
ConnectorFactoryProvider.setDefaultFactory(connectorFactoryInstance)
}
var sessionFactoryInstance = SshSessionFactory.getInstance()
if (sessionFactoryInstance == null) {
sessionFactoryInstance = SshdSessionFactory()
SshSessionFactory.setInstance(sessionFactoryInstance)
}
}