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

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

Introduction

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

Prototype

public void setPushThin(boolean pushThin) 

Source Link

Document

Set thin-pack preference for push operation.

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);
        transport.setOptionReceivePack(RemoteConfig.DEFAULT_RECEIVE_PACK);
        transport.setDryRun(false);/* w ww.  j a  va  2s. c  om*/

        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();
        }
    }

}