Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.IndexDiff.diff()


  public Status call() throws IOException, NoWorkTreeException {
    if (workingTreeIt == null)
      workingTreeIt = new FileTreeIterator(repo);

    IndexDiff diff = new IndexDiff(repo, Constants.HEAD, workingTreeIt);
    diff.diff();

    return new Status(diff);
  }

  /**
 
View Full Code Here


  public Status call() throws IOException, NoWorkTreeException {
    if (workingTreeIt == null)
      workingTreeIt = new FileTreeIterator(repo);

    IndexDiff diff = new IndexDiff(repo, Constants.HEAD, workingTreeIt);
    diff.diff();

    return new Status(diff);
  }

  /**
 
View Full Code Here

      if (ignoreSubmoduleMode != null)
        diff.setIgnoreSubmoduleMode(ignoreSubmoduleMode);
      if (paths != null)
        diff.setFilter(PathFilterGroup.createFromStrings(paths));
      if (progressMonitor == null)
        diff.diff();
      else
        diff.diff(progressMonitor, ProgressMonitor.UNKNOWN,
            ProgressMonitor.UNKNOWN, ""); //$NON-NLS-1$
      return new Status(diff);
    } catch (IOException e) {
View Full Code Here

      if (paths != null)
        diff.setFilter(PathFilterGroup.createFromStrings(paths));
      if (progressMonitor == null)
        diff.diff();
      else
        diff.diff(progressMonitor, ProgressMonitor.UNKNOWN,
            ProgressMonitor.UNKNOWN, ""); //$NON-NLS-1$
      return new Status(diff);
    } catch (IOException e) {
      throw new JGitInternalException(e.getMessage(), e);
    }
View Full Code Here

    public boolean isDirty(boolean ignoreUntracked) throws GitRepositoryException {
        try {
            FileTreeIterator workTreeIterator = new FileTreeIterator(this.repository);
            IndexDiff indexDiff = new IndexDiff(this.repository, this.getHeadObject(), workTreeIterator);
            indexDiff.diff();

            return !ignoreUntracked && !indexDiff.getUntracked().isEmpty() ||
                    !(indexDiff.getAdded().isEmpty() && indexDiff.getChanged().isEmpty() &&
                    indexDiff.getRemoved().isEmpty() &&
                    indexDiff.getMissing().isEmpty() &&
View Full Code Here

    if (workingTreeIt == null)
      workingTreeIt = new FileTreeIterator(repo);

    try {
      IndexDiff diff = new IndexDiff(repo, Constants.HEAD, workingTreeIt);
      diff.diff();
      return new Status(diff);
    } catch (IOException e) {
      throw new JGitInternalException(e.getMessage(), e);
    }
  }
View Full Code Here

    try {
      FileTreeIterator fileTreeIterator = new FileTreeIterator(repository);
      IndexDiff indexDiff = new IndexDiff(repository, Constants.HEAD,
          fileTreeIterator);
      indexDiff.setFilter(PathFilterGroup.createFromStrings(Collections.singletonList(resRelPath)));
      indexDiff.diff();

      return indexDiff.getAdded().contains(resRelPath) || indexDiff.getChanged().contains(resRelPath)
          || indexDiff.getRemoved().contains(resRelPath);
    } catch (IOException e) {
      Activator.error(NLS.bind(UIText.GitHistoryPage_errorLookingUpPath,
View Full Code Here

    AdaptableFileTreeIterator fileTreeIterator = new AdaptableFileTreeIterator(
        repository, ResourcesPlugin.getWorkspace().getRoot());
    IndexDiff indexDiff = new IndexDiff(repository, Constants.HEAD, fileTreeIterator);
    Set<String> repositoryPaths = Collections.singleton(path);
    indexDiff.setFilter(PathFilterGroup.createFromStrings(repositoryPaths));
    indexDiff.diff(null, 0, 0, ""); //$NON-NLS-1$
    return getFileStatus(path, indexDiff);
  }

  /** Retrieve file status from an already calculated IndexDiff
   * @param path
View Full Code Here

      return null; // workspace is closed
    IndexDiff diffForChangedResources = new IndexDiff(repository,
        Constants.HEAD, iterator);
    diffForChangedResources.setFilter(PathFilterGroup
        .createFromStrings(treeFilterPaths));
    diffForChangedResources.diff(jgitMonitor, 0, 0, jobName);
    return new IndexDiffData(indexDiffData, filesToUpdate,
        resourcesToUpdate, diffForChangedResources);
  }

  /*
 
View Full Code Here

    WorkingTreeIterator iterator = IteratorService
        .createInitialIterator(repository);
    if (iterator == null)
      return null; // workspace is closed
    newIndexDiff = new IndexDiff(repository, Constants.HEAD, iterator);
    newIndexDiff.diff(jgitMonitor, 0, 0, jobName);
    return new IndexDiffData(newIndexDiff);
  }

  private String getReloadJobName() {
    String repoName = Activator.getDefault().getRepositoryUtil()
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.