Merge "Use the stored password instead of prompting for it all the time"

This commit is contained in:
Matthias Sohn 2011-05-25 12:08:17 -04:00 committed by Code Review
commit 03a6f572b5
2 changed files with 13 additions and 3 deletions

View File

@ -279,5 +279,15 @@ public static class Password extends CharArrayType {
public Password() { public Password() {
super(JGitText.get().credentialPassword, true); super(JGitText.get().credentialPassword, true);
} }
/**
* Initialize a new password item, with given prompt.
*
* @param msg
* prompt message
*/
public Password(String msg) {
super(msg, true);
}
} }
} }

View File

@ -105,9 +105,9 @@ public boolean promptPassphrase(String msg) {
} }
public boolean promptPassword(String msg) { public boolean promptPassword(String msg) {
CredentialItem.StringType v = newPrompt(msg); CredentialItem.Password p = new CredentialItem.Password(msg);
if (provider.get(uri, v)) { if (provider.get(uri, p)) {
password = v.getValue(); password = new String(p.getValue());
return true; return true;
} else { } else {
password = null; password = null;