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



##########
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:
       There are two possible outcomes of the creation of the SSHAgentConnector:
   
   - instantiation of `SSHAgentConnector` could fail because `junixsocket` 
can't be instatiated
   - the class might be loadable, but there is no agent running
   
   On window this is quite possible. In my work setup I have pagent running and 
an ssh-agent -> pagent bridge in cygwin, but NetBeans uses PAgent directly.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to