Examples of PullCommand


Examples of org.eclipse.jgit.api.PullCommand

    ProgressMonitor gitMonitor = new EclipseGitProgressTransformer(monitor);
    Repository db = null;
    try {
      db = FileRepositoryBuilder.create(GitUtils.getGitDir(path));
      Git git = new Git(db);
      PullCommand pc = git.pull();
      pc.setProgressMonitor(gitMonitor);
      pc.setCredentialsProvider(credentials);
      pc.setTransportConfigCallback(new TransportConfigCallback() {
        @Override
        public void configure(Transport t) {
          credentials.setUri(t.getURI());
          if (t instanceof TransportHttp && cookie != null) {
            HashMap<String, String> map = new HashMap<String, String>();
            map.put(GitConstants.KEY_COOKIE, cookie.getName() + "=" + cookie.getValue());
            ((TransportHttp) t).setAdditionalHeaders(map);
          }
        }
      });
      PullResult pullResult = pc.call();

      if (monitor.isCanceled()) {
        return new Status(IStatus.CANCEL, GitActivator.PI_GIT, "Cancelled");
      }
View Full Code Here

Examples of org.eclipse.jgit.api.PullCommand

   * appropriate Credentials Provider
   */
  private void pull() {
    System.out.println("Updating Master...");
    try {
      PullCommand pull = this.git.pull();
      pull.setCredentialsProvider(this.upc).call();
    } catch (Exception e) {
      System.out.println("Error: Unable to update master");
      e.printStackTrace();
      this.successful = false;
    }
View Full Code Here

Examples of org.eclipse.jgit.api.PullCommand

   }

   @Override
   public PullResult pull(final Git git, final int timeout) throws GitAPIException
   {
      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

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

Examples of org.eclipse.jgit.api.PullCommand

   }

   @Override
   public PullResult pull(final Git git, final int timeout) throws GitAPIException
   {
      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

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

Examples of org.eclipse.jgit.api.PullCommand

      return git;
   }

   public static PullResult pull(final Git git, final int timeout) throws GitAPIException
   {
      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

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

Examples of org.eclipse.jgit.api.PullCommand

        for (int i = 0; i < repositories.length; i++) {
          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);
            pullResult = pull.call();
            results.put(repository, pullResult);
          } catch (DetachedHeadException e) {
            results.put(repository, Activator.error(
                CoreText.PullOperation_DetachedHeadMessage, e));
          } catch (InvalidConfigurationException e) {
View Full Code Here

Examples of org.eclipse.jgit.api.PullCommand

   }

   public static PullResult pull(final Git git, final int timeout) throws WrongRepositoryStateException,
            InvalidConfigurationException, DetachedHeadException, InvalidRemoteException, CanceledException
   {
      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
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.