Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.PullResult


      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here


      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here

      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here

                repository.resolve("refs/heads/master"));

        // TODO: why do we get null here for HEAD?!? See also
// http://stackoverflow.com/questions/17979660/jgit-pull-noheadexception

        PullResult call = new Git(repository).pull().call();

        System.out.println("Pulled from the remote repository: " + call);

        repository.close();
    }
View Full Code Here

          Repository repository = repositories[i];
          if (mymonitor.isCanceled())
            throw new CoreException(Status.CANCEL_STATUS);
          IProject[] validProjects = ProjectUtil.getValidOpenProjects(repository);
          PullCommand pull = new Git(repository).pull();
          PullResult pullResult = null;
          try {
            pull.setProgressMonitor(new EclipseGitProgressTransformer(
                new SubProgressMonitor(mymonitor, 1)));
            pull.setTimeout(timeout);
            pull.setCredentialsProvider(credentialsProvider);
View Full Code Here

      Object resultOrError = item.getValue();
      if (resultOrError instanceof IStatus)
        return PlatformUI.getWorkbench().getSharedImages().getImage(
            ISharedImages.IMG_ELCL_STOP);

      PullResult res = (PullResult) item.getValue();
      boolean success = res.isSuccessful();
      if (!success)
        return PlatformUI.getWorkbench().getSharedImages().getImage(
            ISharedImages.IMG_ELCL_STOP);
      return null;
    }
View Full Code Here

      case 0:
        return utils.getRepositoryName(item.getKey());
      case 1: {
        if (item.getValue() instanceof IStatus)
          return UIText.MultiPullResultDialog_UnknownStatus;
        PullResult pullRes = (PullResult) item.getValue();
        if (pullRes.getFetchResult() == null)
          return UIText.MultiPullResultDialog_NothingFetchedStatus;
        else if (pullRes.getFetchResult().getTrackingRefUpdates()
            .isEmpty())
          return UIText.MultiPullResultDialog_NothingUpdatedStatus;
        else {
          int updated = pullRes.getFetchResult()
              .getTrackingRefUpdates().size();
          if ( updated == 1)
            return UIText.MultiPullResultDialog_UpdatedOneMessage;
          return NLS.bind(
              UIText.MultiPullResultDialog_UpdatedMessage,
              Integer.valueOf(updated));
        }
      }
      case 2: {
        if (item.getValue() instanceof IStatus)
          return UIText.MultiPullResultDialog_UnknownStatus;
        PullResult pullRes = (PullResult) item.getValue();
        if (pullRes.getMergeResult() != null) {
          return NLS.bind(
              UIText.MultiPullResultDialog_MergeResultMessage,
              MergeResultDialog.getStatusText(pullRes
                  .getMergeResult().getMergeStatus()));
        } else if (pullRes.getRebaseResult() != null) {
          RebaseResult res = pullRes.getRebaseResult();
          return NLS.bind(
              UIText.MultiPullResultDialog_RebaseResultMessage,
              RebaseResultDialog.getStatusText(res.getStatus()));
        } else {
          return UIText.MultiPullResultDialog_NothingUpdatedStatus;
        }
      }
      case 3:
        if (item.getValue() instanceof IStatus) {
          IStatus status = (IStatus) item.getValue();
          return status.getMessage();
        }
        PullResult res = (PullResult) item.getValue();
        if (res.isSuccessful())
          return UIText.MultiPullResultDialog_OkStatus;
        else
          return UIText.MultiPullResultDialog_FailedStatus;
      default:
        return null;
View Full Code Here

  private void handlePullResults(final Map<Repository, Object> resultsMap,
      Shell shell) {
    for (Entry<Repository, Object> entry : resultsMap.entrySet()) {
      Object result = entry.getValue();
      if (result instanceof PullResult) {
        PullResult pullResult = (PullResult) result;
        if (pullResult.getRebaseResult() != null
            && RebaseResult.Status.UNCOMMITTED_CHANGES == pullResult
                .getRebaseResult().getStatus()) {
          handleUncommittedChanges(entry.getKey(), pullResult
              .getRebaseResult().getUncommittedChanges(), shell);
        }
      }
    }
View Full Code Here

      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.api.PullResult

Copyright © 2018 www.massapicom. 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.