]> source.dussan.org Git - jgit.git/commitdiff
PushCommand: do not set a null credentials provider 00/2400/1
authorJens Baumgart <jens.baumgart@sap.com>
Wed, 2 Feb 2011 12:13:28 +0000 (13:13 +0100)
committerJens Baumgart <jens.baumgart@sap.com>
Wed, 2 Feb 2011 12:13:28 +0000 (13:13 +0100)
PushCommand now does not set a null credentials provider on
Transport because in this case the default provider is replaced with
null and the default mechanism for providing credentials is not
working.

Bug: 336023
Change-Id: I7a7a9221afcfebe2e1595a5e59641e6c1ae4a207
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java

index 3a35827b9a610da0fe1170a6adb3300f3b304709..e8175d0997568c50160d9759b42adb674a667af2 100644 (file)
@@ -139,7 +139,8 @@ public class PushCommand extends GitCommand<Iterable<PushResult>> {
                                if (receivePack != null)
                                        transport.setOptionReceivePack(receivePack);
                                transport.setDryRun(dryRun);
-                               transport.setCredentialsProvider(credentialsProvider);
+                               if (credentialsProvider != null)
+                                       transport.setCredentialsProvider(credentialsProvider);
 
                                final Collection<RemoteRefUpdate> toPush = transport
                                                .findRemoteRefUpdatesFor(refSpecs);