Browse Source

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 <matthias.sohn@sap.com>
stable-4.3
Matthias Sohn 9 years ago
parent
commit
5786cc3c0f
  1. 10
      org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java

10
org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java

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

Loading…
Cancel
Save