Example usage for org.eclipse.jgit.transport Transport setOptionReceivePack

List of usage examples for org.eclipse.jgit.transport Transport setOptionReceivePack

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport Transport setOptionReceivePack.

Prototype

public void setOptionReceivePack(String optionReceivePack) 

Source Link

Document

Set remote executable providing receive-pack service for pack transports.

Usage

From source file:org.kuali.student.git.importer.JGitPushMain.java

License:Educational Community License

public static void push(Repository repo, String remoteName, List<RemoteRefUpdate> refsToUpdate,
        String remoteUserName, String remotePassword) throws IOException, URISyntaxException {

    ArrayList<PushResult> pushResults = new ArrayList<PushResult>(3);

    RemoteConfig config = new RemoteConfig(repo.getConfig(), remoteName);

    final List<Transport> transports;
    transports = Transport.openAll(repo, config, Transport.Operation.PUSH);

    for (final Transport transport : transports) {
        transport.setPushThin(false);/*ww w.ja  v  a  2 s  .  c o m*/
        transport.setOptionReceivePack(RemoteConfig.DEFAULT_RECEIVE_PACK);
        transport.setDryRun(false);

        configure(transport, remoteUserName, remotePassword);

        try {
            PushResult result = transport.push(new TextProgressMonitor(), refsToUpdate, System.out);
            pushResults.add(result);

        } catch (TransportException e) {
            throw new TransportException(e.getMessage(), e);
        } finally {
            transport.close();
        }
    }

}