Source:
public Iterable<PushResult> call() throws JGitInternalException, InvalidRemoteException { checkCallable(); ArrayList<PushResult> pushResults = new ArrayList<PushResult>(3); try { if (refSpecs.isEmpty()) { RemoteConfig config = new RemoteConfig(repo.getConfig(), getRemote()); refSpecs.addAll(config.getPushRefSpecs()); } if (refSpecs.isEmpty()) { Ref head = repo.getRef(Constants.HEAD); if (head != null && head.isSymbolic()) refSpecs.add(DEFAULT_PUSH_REF_SPEC); } if (force) { for (int i = 0; i < refSpecs.size(); i++) refSpecs.set(i, refSpecs.get(i).setForceUpdate(true)); } final List<Transport> transports; transports = Transport.openAll(repo, remote, Transport.Operation.PUSH); for (final Transport transport : transports) { if (0 <= timeout) transport.setTimeout(timeout); transport.setPushThin(thin); if (receivePack != null) transport.setOptionReceivePack(receivePack); transport.setDryRun(dryRun); if (credentialsProvider != null) transport.setCredentialsProvider(credentialsProvider); final Collection<RemoteRefUpdate> toPush = transport .findRemoteRefUpdatesFor(refSpecs); try { PushResult result = transport.push(monitor, toPush); pushResults.add(result); } catch (TransportException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfPushCommand, e); } finally { transport.close(); } } } catch (URISyntaxException e) { throw new InvalidRemoteException(MessageFormat.format( JGitText.get().invalidRemote, remote)); } catch (NotSupportedException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfPushCommand, e); } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfPushCommand, e); } return pushResults; }

Target:
public Iterable<PushResult> call() throws JGitInternalException, InvalidRemoteException { checkCallable(); ArrayList<PushResult> pushResults = new ArrayList<PushResult>(3); try { if (refSpecs.isEmpty()) { RemoteConfig config = new RemoteConfig(repo.getConfig(), getRemote()); refSpecs.addAll(config.getPushRefSpecs()); } if (refSpecs.isEmpty()) { Ref head = repo.getRef(Constants.HEAD); if (head != null && head.isSymbolic()) refSpecs.add(new RefSpec(head.getLeaf().getName())); } if (force) { for (int i = 0; i < refSpecs.size(); i++) refSpecs.set(i, refSpecs.get(i).setForceUpdate(true)); } final List<Transport> transports; transports = Transport.openAll(repo, remote, Transport.Operation.PUSH); for (final Transport transport : transports) { if (0 <= timeout) transport.setTimeout(timeout); transport.setPushThin(thin); if (receivePack != null) transport.setOptionReceivePack(receivePack); transport.setDryRun(dryRun); if (credentialsProvider != null) transport.setCredentialsProvider(credentialsProvider); final Collection<RemoteRefUpdate> toPush = transport .findRemoteRefUpdatesFor(refSpecs); try { PushResult result = transport.push(monitor, toPush); pushResults.add(result); } catch (TransportException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfPushCommand, e); } finally { transport.close(); } } } catch (URISyntaxException e) { throw new InvalidRemoteException(MessageFormat.format( JGitText.get().invalidRemote, remote)); } catch (NotSupportedException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfPushCommand, e); } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfPushCommand, e); } return pushResults; }