From 5786cc3c0fb1afdd9942e9a353c6fc755a6b41d7 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Fri, 27 Nov 2015 11:23:42 +0100 Subject: [PATCH] Fix ChainingCredentialsProvider 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 --- .../jgit/transport/ChainingCredentialsProvider.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java index 3e0ee2f64..5e1eb3c49 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java @@ -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; } }