]> source.dussan.org Git - jgit.git/commitdiff
Fix ChainingCredentialsProvider 18/62118/2
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 27 Nov 2015 10:23:42 +0000 (11:23 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 8 Dec 2015 13:12:26 +0000 (14:12 +0100)
The ChainingCredentialsProvider gave up chaining to the next provider if
the first one returned no credentials items for the given URI.

Change-Id: I9539c50db35e564db9d43d8ebb71d7e9c6fdcc19
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java

index 3e0ee2f645b5bfc4caf87f79c99fc45182266914..5e1eb3c4936578c76ce816fcdfb2d6e4ffe5eb41 100644 (file)
@@ -113,9 +113,15 @@ public class ChainingCredentialsProvider extends CredentialsProvider {
                        throws UnsupportedCredentialItem {
                for (CredentialsProvider p : credentialProviders) {
                        if (p.supports(items)) {
-                               p.get(uri, items);
-                               if (isAnyNull(items))
+                               if (!p.get(uri, items)) {
+                                       if (p.isInteractive()) {
+                                               return false; // user cancelled the request
+                                       }
                                        continue;
+                               }
+                               if (isAnyNull(items)) {
+                                       continue;
+                               }
                                return true;
                        }
                }