Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.FetchResult


        CLIText.get().initializedEmptyGitRepositoryIn, gitdir));
    outw.println();
    outw.flush();

    saveRemote(uri);
    final FetchResult r = runFetch();

    if (!noCheckout) {
      final Ref checkoutRef;
      if (branch == null)
        checkoutRef = guessHEAD(r);
      else {
        checkoutRef = r.getAdvertisedRef(Constants.R_HEADS + branch);
        if (checkoutRef == null)
          throw die(MessageFormat.format(
              CLIText.get().noSuchRemoteRef, branch));
      }
      doCheckout(checkoutRef);
View Full Code Here


    dstcfg.save();
  }

  private FetchResult runFetch() throws URISyntaxException, IOException {
    final Transport tn = Transport.open(db, remoteName);
    final FetchResult r;
    try {
      tn.setTagOpt(TagOpt.FETCH_TAGS);
      r = tn.fetch(new TextProgressMonitor(), null);
    } finally {
      tn.close();
View Full Code Here

        if (tagOption != null)
          transport.setTagOpt(tagOption);
        transport.setFetchThin(thin);
        configure(transport);

        FetchResult result = transport.fetch(monitor, refSpecs);
        return result;
      } finally {
        transport.close();
      }
    } catch (NoRemoteRepositoryException e) {
View Full Code Here

      // handle result
      if (pullResult.isSuccessful()) {
        return Status.OK_STATUS;
      }
      FetchResult fetchResult = pullResult.getFetchResult();

      IStatus fetchStatus = FetchJob.handleFetchResult(fetchResult);
      if (!fetchStatus.isOK()) {
        return fetchStatus;
      }
View Full Code Here

        RefSpec spec = new RefSpec(Constants.R_HEADS + remoteBranch + ":" + Constants.R_REMOTES + remote + "/" + branch); //$NON-NLS-1$ //$NON-NLS-2$
        spec = spec.setForceUpdate(force);
        fc.setRefSpecs(spec);
      }
      FetchResult fetchResult = fc.call();
      if (monitor.isCanceled()) {
        return new Status(IStatus.CANCEL, GitActivator.PI_GIT, "Cancelled");
      }
      GitJobUtils.packRefs(db, gitMonitor);
      if (monitor.isCanceled()) {
View Full Code Here

    out.format(CLIText.get().initializedEmptyGitRepositoryIn, gitdir.getAbsolutePath());
    out.println();
    out.flush();

    saveRemote(uri);
    final FetchResult r = runFetch();
    final Ref branch = guessHEAD(r);
    doCheckout(branch);
  }
View Full Code Here

  }

  private FetchResult runFetch() throws NotSupportedException,
      URISyntaxException, TransportException {
    final Transport tn = Transport.open(db, remoteName);
    final FetchResult r;
    try {
      r = tn.fetch(new TextProgressMonitor(), null);
    } finally {
      tn.close();
    }
View Full Code Here

    tn.setDryRun(dryRun);
    if (thin != null)
      tn.setFetchThin(thin.booleanValue());
    if (0 <= timeout)
      tn.setTimeout(timeout);
    final FetchResult r;
    try {
      r = tn.fetch(new TextProgressMonitor(), toget);
      if (r.getTrackingRefUpdates().isEmpty())
        return;
    } finally {
      tn.close();
    }
    showFetchResult(tn, r);
View Full Code Here

      fetch.setDryRun(dryRun);
      fetch.setRemote(remote);
      fetch.setThin(thin);
      fetch.setProgressMonitor(new TextProgressMonitor());

      FetchResult result = fetch.call();
      return result;
   }
View Full Code Here

   public List<Ref> getRemoteBranches(final Git repo) throws GitAPIException
   {
      List<Ref> results = new ArrayList<>();
      try
      {
         FetchResult fetch = repo.fetch().setRemote(GIT_REMOTE_ORIGIN).call();
         Collection<Ref> refs = fetch.getAdvertisedRefs();
         for (Ref ref : refs)
         {
            if (ref.getName().startsWith(GIT_REFS_HEADS))
            {
               results.add(ref);
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.FetchResult

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.