Examples of PushResult


Examples of org.eclipse.jgit.transport.PushResult

            Transport transport = Transport.open(localDb, uri);
            transport.setDryRun(dryRun);
            transport.setTimeout(timeout);
            if (credentialsProvider != null)
              transport.setCredentialsProvider(credentialsProvider);
            PushResult result = transport.push(gitSubMonitor, refUpdates, out);

            operationResult.addOperationResult(result.getURI(), result);
            specification.addURIRefUpdates(result.getURI(), result.getRemoteUpdates());
          } catch (JGitInternalException e) {
            String errorMessage = e.getCause() != null ? e
                .getCause().getMessage() : e.getMessage();
            String userMessage = NLS.bind(
                    CoreText.PushOperation_InternalExceptionOccurredMessage,
                    errorMessage);
            handleException(uri, e, userMessage);
          } catch (Exception e) {
            handleException(uri, e, e.getMessage());
          }

          monitor.worked(WORK_UNITS_PER_TRANSPORT);
        } finally {
          // Dirty trick to get things always working.
          subMonitor.beginTask("", WORK_UNITS_PER_TRANSPORT); //$NON-NLS-1$
          subMonitor.done();
          subMonitor.done();
        }
      }
    else {
      final EclipseGitProgressTransformer gitMonitor = new EclipseGitProgressTransformer(
          monitor);
      try {
        Iterable<PushResult> results = git.push().setRemote(
            remoteName).setDryRun(dryRun).setTimeout(timeout)
            .setProgressMonitor(gitMonitor).setCredentialsProvider(
credentialsProvider)
            .setOutputStream(out).call();
        for (PushResult result : results) {
          operationResult.addOperationResult(result.getURI(), result);
        }
      } catch (JGitInternalException e) {
        String errorMessage = e.getCause() != null ? e.getCause()
            .getMessage() : e.getMessage();
        String userMessage = NLS.bind(
View Full Code Here

Examples of org.eclipse.jgit.transport.PushResult

    PushOperation push = new PushOperation(repository2.getRepository(),
        spec, false, 0);
    push.run(null);

    PushOperationResult result = push.getOperationResult();
    PushResult pushResult = result.getPushResult(remote);
    assertNotNull("Expected result to have tracking ref update", pushResult.getTrackingRefUpdate(trackingRef));

    ObjectId trackingId = repository2.getRepository().resolve(trackingRef);
    assertEquals("Expected tracking branch to be updated", commit.getId(), trackingId);
  }
View Full Code Here

Examples of org.eclipse.jgit.transport.PushResult

        List<RemoteRefUpdate> acceptedUpdates = new ArrayList<>();
        List<RemoteRefUpdate> rejectedUpdates = new ArrayList<>();
       
        // Collect the updates that are not ok
        while (resit.hasNext()) {
            PushResult pushResult = resit.next();
            pushResults.add(pushResult);
            for (RemoteRefUpdate refUpdate : pushResult.getRemoteUpdates()) {
                Status status = refUpdate.getStatus();
                if (status == Status.OK || status == Status.UP_TO_DATE) {
                    acceptedUpdates.add(refUpdate);
                } else {
                    rejectedUpdates.add(refUpdate);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.