Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.FetchResult


        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


  public Git call() throws GitAPIException, InvalidRemoteException,
      org.eclipse.jgit.api.errors.TransportException {
    try {
      URIish u = new URIish(uri);
      Repository repository = init(u);
      FetchResult result = fetch(repository, u);
      if (!noCheckout)
        checkout(repository, result);
      return new Git(repository);
    } catch (IOException ioe) {
      throw new JGitInternalException(ioe.getMessage(), ioe);
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 static List<Ref> getRemoteBranches(final Git repo) throws GitAPIException
   {
      List<Ref> results = new ArrayList<Ref>();
      try
      {
         FetchResult fetch = repo.fetch().setRemote("origin").call();
         Collection<Ref> refs = fetch.getAdvertisedRefs();
         for (Ref ref : refs)
         {
            if (ref.getName().startsWith("refs/heads"))
            {
               results.add(ref);
View Full Code Here

    String taskName = NLS
        .bind(UIText.FetchGerritChangePage_FetchingTaskName,
            spec.getSource());
    monitor.setTaskName(taskName);
    FetchResult fetchRes = new FetchOperationUI(repository,
        new URIish(uri), specs, timeout, false).execute(monitor);

    monitor.worked(1);
    return new RevWalk(repository).parseCommit(fetchRes.getAdvertisedRef(
        spec.getSource()).getObjectId());
  }
View Full Code Here

      public Object[] getElements(Object inputElement) {
        if (inputElement == null)
          return new FetchResultAdapter[0];

        final FetchResult result = (FetchResult) inputElement;
        TrackingRefUpdate[] updates = result.getTrackingRefUpdates()
            .toArray(new TrackingRefUpdate[0]);
        FetchResultAdapter[] elements = new FetchResultAdapter[updates.length];
        for (int i = 0; i < elements.length; i++)
          elements[i] = new FetchResultAdapter(updates[i]);
        return elements;
View Full Code Here

class TrackingRefUpdateContentProvider implements IStructuredContentProvider {
  public Object[] getElements(final Object inputElement) {
    if (inputElement == null)
      return new TrackingRefUpdate[0];

    final FetchResult result = (FetchResult) inputElement;
    return result.getTrackingRefUpdates().toArray(new TrackingRefUpdate[0]);
  }
View Full Code Here

    this.result = result;
    persistSize = hasFetchResults() || hasMergeResults();
  }

  private boolean hasFetchResults() {
    final FetchResult fetchResult = result.getFetchResult();
    return fetchResult != null
        && !fetchResult.getTrackingRefUpdates().isEmpty();
  }
View Full Code Here

    fetchResultGroup
        .setText(UIText.PullResultDialog_FetchResultGroupHeader);
    GridLayoutFactory.fillDefaults().applyTo(fetchResultGroup);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(
        fetchResultGroup);
    FetchResult fRes = result.getFetchResult();
    if (hasFetchResults()) {
      GridLayoutFactory.fillDefaults().applyTo(fetchResultGroup);
      FetchResultDialog dlg = new FetchResultDialog(getParentShell(),
          repo, fRes, result.getFetchedFrom());
      Control fresult = dlg.createFetchResultTable(fetchResultGroup);
View Full Code Here

    public static void main(String[] args) throws IOException, GitAPIException {
        Repository repository = CookbookHelper.openJGitCookbookRepository();

        System.out.println("Starting fetch");
        FetchResult result = new Git(repository).fetch().setCheckFetchedObjects(true).call();
        System.out.println("Messages: " + result.getMessages());

        repository.close();
    }
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.