Browse Source

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

tags/v1.0.0.201106011211-rc3
Matthias Sohn 13 years ago
parent
commit
03a6f572b5

+ 10
- 0
org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialItem.java View File

@@ -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);
}
}
}

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java View File

@@ -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;

Loading…
Cancel
Save