RefSpec spec = new RefSpec(srcRef + ':' + (pushToGerrit ? "refs/" : Constants.R_HEADS) + branch);
pushCommand.setRemote(remote).setRefSpecs(spec);
if (tags)
pushCommand.setPushTags();
pushCommand.setForce(force);
Iterable<PushResult> resultIterable = pushCommand.call();
if (monitor.isCanceled()) {
return new Status(IStatus.CANCEL, GitActivator.PI_GIT, "Cancelled");
}
PushResult pushResult = resultIterable.iterator().next();
boolean error = false;