diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2011-05-25 12:08:17 -0400 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-05-25 12:08:17 -0400 |
commit | 03a6f572b5968dc8f77b5c85e3097448df6ea27e (patch) | |
tree | 0850e3d5f777008f2dd45a38aa3927a16a5a89cb /org.eclipse.jgit | |
parent | b8c508e54d64628660aa0d907b37a9648923c1f5 (diff) | |
parent | 486e22c91f607bb15ddf3cd301f494912805127f (diff) | |
download | jgit-03a6f572b5968dc8f77b5c85e3097448df6ea27e.tar.gz jgit-03a6f572b5968dc8f77b5c85e3097448df6ea27e.zip |
Merge "Use the stored password instead of prompting for it all the time"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialItem.java | 10 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialItem.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialItem.java index 55ce4db626..58a63591f2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialItem.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialItem.java @@ -279,5 +279,15 @@ public abstract class CredentialItem { public Password() { super(JGitText.get().credentialPassword, true); } + + /** + * Initialize a new password item, with given prompt. + * + * @param msg + * prompt message + */ + public Password(String msg) { + super(msg, true); + } } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java index 8f259c6765..927822bd8b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java @@ -105,9 +105,9 @@ public class CredentialsProviderUserInfo implements UserInfo, } public boolean promptPassword(String msg) { - CredentialItem.StringType v = newPrompt(msg); - if (provider.get(uri, v)) { - password = v.getValue(); + CredentialItem.Password p = new CredentialItem.Password(msg); + if (provider.get(uri, p)) { + password = new String(p.getValue()); return true; } else { password = null; |