summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorCarsten Pfeiffer2011-05-23 18:17:01 (EDT)
committer Matthias Sohn2011-05-23 18:17:01 (EDT)
commit486e22c91f607bb15ddf3cd301f494912805127f (patch)
treeab438858da524769b28432d8dc25e7413f75648b
parent40fa75feb4536218a59b4cb6ea71e3579c8000dd (diff)
downloadjgit-486e22c91f607bb15ddf3cd301f494912805127f.zip
jgit-486e22c91f607bb15ddf3cd301f494912805127f.tar.gz
jgit-486e22c91f607bb15ddf3cd301f494912805127f.tar.bz2
Use the stored password instead of prompting for it all the timerefs/changes/22/2722/4
EGit change Iba3b87293c22e5fe7d989fc312184aa7463c4387 is also required to make this work for EGit. Change-Id: Iedc80e133e66d72e78ff0980b6e12634f75eca36 Signed-off-by: Carsten Pfeiffer <carsten.pfeiffer@gebit.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialItem.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java6
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 55ce4db..58a6359 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 8f259c6..927822b 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;