Examples of DiffConfig


Examples of org.eclipse.jgit.diff.DiffConfig

   */
  private TreeFilter createFollowFilterFor(List<String> paths) {
    if (paths == null || paths.isEmpty())
      throw new IllegalArgumentException("paths must not be null nor empty"); //$NON-NLS-1$

    DiffConfig diffConfig = currentRepo.getConfig().get(DiffConfig.KEY);

    List<TreeFilter> followFilters = new ArrayList<TreeFilter>(paths.size());
    for (String path : paths)
      followFilters.add(createFollowFilter(path, diffConfig));

View Full Code Here

Examples of org.eclipse.jgit.diff.DiffConfig

    RevWalk rw = new RevWalk(repository);
    rw.sort(RevSort.COMMIT_TIME_DESC, true);
    rw.sort(RevSort.BOUNDARY, true);
    try {
      if (path.length() > 0) {
        DiffConfig diffConfig = repository.getConfig().get(
            DiffConfig.KEY);
        FollowFilter filter = FollowFilter.create(path, diffConfig);
        rw.setTreeFilter(filter);
      }
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffConfig

    List<TreeFilter> filters = new ArrayList<TreeFilter>();
    for (IResource resource : filterResources) {
      RepositoryMapping mapping = RepositoryMapping.getMapping(resource);
      if (mapping != null) {
        DiffConfig diffConfig = mapping.getRepository().getConfig().get(DiffConfig.KEY);
        String path = mapping.getRepoRelativePath(resource);
        if (path != null && !"".equals(path)) { //$NON-NLS-1$
          if (resource.getType() == IResource.FILE)
            filters.add(FollowFilter.create(path, diffConfig));
          else
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffConfig

      String oldPath = gitPath;

      try {
        reader = repository.newObjectReader();
        baselineCommit = rw.parseCommit(commitId);
        DiffConfig diffConfig = repository.getConfig().get(
            DiffConfig.KEY);
        if (diffConfig.getRenameDetectionType() != RenameDetectionType.FALSE) {
          TreeWalk walk = new TreeWalk(repository);
          CanonicalTreeParser baseLineIterator = new CanonicalTreeParser();
          baseLineIterator.reset(reader, baselineCommit.getTree());
          walk.addTree(baseLineIterator);
          walk.addTree(new DirCacheIterator(repository.readDirCache()));
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffConfig

  private static DiffEntry diffFile(Repository repo, String oldCommit,
    String newCommit, String path) throws IOException, GitAPIException {
    Config config = new Config();
    config.setBoolean("diff", null, "renames", true);
    DiffConfig diffConfig = config.get(DiffConfig.KEY);
    List<DiffEntry> diffList = new Git(repo).diff().
      setOldTree(prepareTreeParser(repo, oldCommit)).
      setNewTree(prepareTreeParser(repo, newCommit)).
      setPathFilter(FollowFilter.create(path, diffConfig)).
      call();
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.