Example usage for org.eclipse.jgit.transport RemoteConfig DEFAULT_RECEIVE_PACK

List of usage examples for org.eclipse.jgit.transport RemoteConfig DEFAULT_RECEIVE_PACK

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport RemoteConfig DEFAULT_RECEIVE_PACK.

Prototype

String DEFAULT_RECEIVE_PACK

To view the source code for org.eclipse.jgit.transport RemoteConfig DEFAULT_RECEIVE_PACK.

Click Source Link

Document

Default value for #getReceivePack() if not specified.

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);//from www .ja v a  2s  .  co 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();
        }
    }

}