List of usage examples for org.eclipse.jgit.transport ChainingCredentialsProvider ChainingCredentialsProvider
public ChainingCredentialsProvider(CredentialsProvider... providers)
From source file:com.mooregreatsoftware.gitprocess.lib.Pusher.java
License:Apache License
private static ThePushResult doJGitPush(GitLib gitLib, Branch localBranch, String remoteBranchName, boolean forcePush, String remoteName) { final Iterable<PushResult> pushResults = Try.of(() -> gitLib.jgit().push().setRemote(remoteName) .setRefSpecs(new RefSpec(localBranch.shortName() + ":" + remoteBranchName)).setForce(forcePush) .setCredentialsProvider(new ChainingCredentialsProvider(new NetRCCredentialsProvider())) .setTransportConfigCallback(new GitTransportConfigCallback()).call()).get(); return new JGitPushResult(pushResults); }