diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2015-11-27 11:26:38 +0100 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2015-12-15 12:49:08 +0100 |
commit | 741829f1775a199514af7ca05d35ba39fd934668 (patch) | |
tree | 119dcfd9b319ab8c13864ab7b6e07e7bb327c2be /org.eclipse.jgit.ui | |
parent | 5c66ad56841f8841b8aeb60c61cc4c2ec064a6f4 (diff) | |
download | jgit-741829f1775a199514af7ca05d35ba39fd934668.tar.gz 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>
Diffstat (limited to 'org.eclipse.jgit.ui')
-rw-r--r-- | org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtCredentialsProvider.java | 7 |
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 |