Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2015-11-27 10:26:38 +0000
committerChristian Halstrick2015-12-15 11:49:08 +0000
commit741829f1775a199514af7ca05d35ba39fd934668 (patch)
tree119dcfd9b319ab8c13864ab7b6e07e7bb327c2be
parent5c66ad56841f8841b8aeb60c61cc4c2ec064a6f4 (diff)
downloadjgit-741829f1775a199514af7ca05d35ba39fd934668.tar.gz
jgit-741829f1775a199514af7ca05d35ba39fd934668.tar.xz
jgit-741829f1775a199514af7ca05d35ba39fd934668.zip
Enable retrieval of credentials from .netrc for AwtCredentialsProvider
This was done for ConsoleCredentialsProvider earlier, we need the AwtCredentialsProvider for debugging jgit command line since there is no console in Eclipse. Hence also add support for .netrc here. Change-Id: Ibbd45b73efc663821866754454cea65e6d03f832 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java
index fd26bfa7f9..a9967ae49e 100644
--- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java
+++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java
@@ -56,15 +56,20 @@ import javax.swing.JPasswordField;
import javax.swing.JTextField;
import org.eclipse.jgit.errors.UnsupportedCredentialItem;
+import org.eclipse.jgit.transport.ChainingCredentialsProvider;
import org.eclipse.jgit.transport.CredentialItem;
import org.eclipse.jgit.transport.CredentialsProvider;
+import org.eclipse.jgit.transport.NetRCCredentialsProvider;
import org.eclipse.jgit.transport.URIish;
/** Interacts with the user during authentication by using AWT/Swing dialogs. */
public class AwtCredentialsProvider extends CredentialsProvider {
/** Install this implementation as the default. */
public static void install() {
- CredentialsProvider.setDefault(new AwtCredentialsProvider());
+ final AwtCredentialsProvider c = new AwtCredentialsProvider();
+ CredentialsProvider cp = new ChainingCredentialsProvider(
+ new NetRCCredentialsProvider(), c);
+ CredentialsProvider.setDefault(cp);
}
@Override

Back to the top