You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/05 19:09:38 UTC

[GitHub] [netbeans] vieiro commented on a change in pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

vieiro commented on a change in pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#discussion_r820138218



##########
File path: ide/libs.git/src/org/netbeans/libs/git/jgit/JGitSshSessionFactory.java
##########
@@ -167,9 +177,25 @@ protected Session createSession (Host hc, String user, String host, int port, FS
     private boolean setupJSchIdentityRepository (JSch jsch, String identityFile, boolean preferAgent) throws JSchException {
         boolean agentUsed = false;
         if (preferAgent) {
-            Connector con = ConnectorFactory.getInstance().createConnector(ConnectorFactory.ConnectorKind.ANY);
-            if (con != null) {
-                IdentityRepository irepo = new IdentityRepositoryImpl(con);
+            AgentConnector agentConnector = null;
+            try {
+                 agentConnector = new SSHAgentConnector();
+                 if(! agentConnector.isAvailable()) {
+                     agentConnector = null;
+                 }
+            } catch (Throwable ex) {
+                LOG.log(Level.FINE, null, ex);
+            }
+            try {
+                agentConnector = new PageantConnector();

Review comment:
       Why create a new "PageantConnector()" on line 190 if we've already created a SSHAgentConnector on line 182 above?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists