]> source.dussan.org Git - jgit.git/commitdiff
Use the stored password instead of prompting for it all the time 22/2722/4
authorCarsten Pfeiffer <carsten.pfeiffer@gebit.de>
Mon, 23 May 2011 22:17:01 +0000 (00:17 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 23 May 2011 22:17:01 +0000 (00:17 +0200)
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>
org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialItem.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java

index 55ce4db6268785ee27c091d824f5334f0fda74f2..58a63591f283c88b9f6b2ffd93dbf0ccfef94715 100644 (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);
+               }
        }
 }
index 8f259c67657fd9f0874bc7f2d90a96a7a90ece82..927822bd8bde997fdbde3ecde8aeab21eadb8d5b 100644 (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;