Example usage for org.eclipse.jgit.transport PushResult PushResult

List of usage examples for org.eclipse.jgit.transport PushResult PushResult

Introduction

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

Prototype

PushResult

Source Link

Usage

From source file:com.google.gerrit.server.git.PushOp.java

License:Apache License

private PushResult pushVia(final Transport tn) throws IOException, NotSupportedException, TransportException {
    tn.applyConfig(config);/*from   w w w. ja va  2s . c  om*/
    tn.setCredentialsProvider(credentialsProvider);

    final List<RemoteRefUpdate> todo = generateUpdates(tn);
    if (todo.isEmpty()) {
        // If we have no commands selected, we have nothing to do.
        // Calling JGit at this point would just redo the work we
        // already did, and come up with the same answer. Instead
        // send back an empty result.
        //
        return new PushResult();
    }

    return tn.push(NullProgressMonitor.INSTANCE, todo);
}

From source file:com.googlesource.gerrit.plugins.replication.PushOne.java

License:Apache License

private PushResult pushVia(Transport tn) throws IOException, NotSupportedException, TransportException {
    tn.applyConfig(config);//from   w  ww .ja  v  a2 s . co  m
    tn.setCredentialsProvider(credentialsProvider);

    List<RemoteRefUpdate> todo = generateUpdates(tn);
    if (todo.isEmpty()) {
        // If we have no commands selected, we have nothing to do.
        // Calling JGit at this point would just redo the work we
        // already did, and come up with the same answer. Instead
        // send back an empty result.
        return new PushResult();
    }

    repLog.info("Push to " + uri + " references: " + todo);

    return tn.push(NullProgressMonitor.INSTANCE, todo);
}