Package org.eclipse.jgit.treewalk

Examples of org.eclipse.jgit.treewalk.TreeWalk.reset()


    try {
      dc = repo.lockDirCache();
      DirCacheBuilder builder = dc.builder();
      final TreeWalk tw = new TreeWalk(repo);
      tw.reset(); // drop the first empty tree, which we do not need here
      tw.setRecursive(true);
      tw.setFilter(PathFilterGroup.createFromStrings(filepatterns));
      tw.addTree(new DirCacheBuildIterator(builder));

      while (tw.next()) {
View Full Code Here


      if ((p.flags & PARSED) == 0)
        p.parseHeaders(walker);
      trees[i] = p.getTree();
    }
    trees[nParents] = c.getTree();
    tw.reset(trees);

    if (nParents == 1) {
      // We have exactly one parent. This is a very common case.
      //
      int chgs = 0, adds = 0;
View Full Code Here

      throws MissingObjectException, IncorrectObjectTypeException,
      CorruptObjectException, IOException {
    TreeWalk tw = pathFilter;
    FollowFilter oldFilter = (FollowFilter) tw.getFilter();
    tw.setFilter(TreeFilter.ANY_DIFF);
    tw.reset(trees);

    List<DiffEntry> files = DiffEntry.scan(tw);
    RenameDetector rd = new RenameDetector(repository);
    rd.addAll(files);
    files = rd.compute();
View Full Code Here

    if (hasUnmergedPaths)
      throw new UnmergedPathsException();

    // determine whether we need to commit
    TreeWalk treeWalk = new TreeWalk(repo);
    treeWalk.reset();
    treeWalk.setRecursive(true);
    treeWalk.addTree(new DirCacheIterator(dc));
    ObjectId id = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$
    if (id == null)
      throw new NoHeadException(
View Full Code Here

      // came from so we can properly show the rename or copy,
      // then continue digging backwards.
      //
      a.reset();
      b.reset();
      walk.reset();
      walk.addTree(a);
      walk.addTree(b);
      walk.setFilter(filter);

      if (renameDetector == null)
View Full Code Here

                return list;
            }

            if (commit.getParentCount() == 0) {
                TreeWalk tw = new TreeWalk(repository);
                tw.reset();
                tw.setRecursive(true);
                tw.addTree(commit.getTree());
                while (tw.next()) {
                    list.add(tw.getPathString());
                }
View Full Code Here

      if ((p.flags & PARSED) == 0)
        p.parseHeaders(walker);
      trees[i] = p.getTree();
    }
    trees[nParents] = c.getTree();
    tw.reset(trees);

    if (nParents == 1) {
      // We have exactly one parent. This is a very common case.
      //
      int chgs = 0, adds = 0;
View Full Code Here

      throws MissingObjectException, IncorrectObjectTypeException,
      CorruptObjectException, IOException {
    TreeWalk tw = pathFilter;
    FollowFilter oldFilter = (FollowFilter) tw.getFilter();
    tw.setFilter(TreeFilter.ANY_DIFF);
    tw.reset(trees);

    List<DiffEntry> files = DiffEntry.scan(tw);
    RenameDetector rd = new RenameDetector(tw.getObjectReader(), cfg);
    rd.addAll(files);
    files = rd.compute();
View Full Code Here

    try {
      dc = repo.lockDirCache();
      DirCacheBuilder builder = dc.builder();
      final TreeWalk tw = new TreeWalk(repo);
      tw.reset(); // drop the first empty tree, which we do not need here
      tw.setRecursive(true);
      tw.setFilter(PathFilterGroup.createFromStrings(filepatterns));
      tw.addTree(new DirCacheBuildIterator(builder));

      while (tw.next()) {
View Full Code Here

      try {
        final MutableObjectId idBuf = new MutableObjectId();
        final ObjectReader reader = walk.getObjectReader();
        final RevWalk rw = new RevWalk(walk.getObjectReader());

        walk.reset(rw.parseTree(tree));
        walk.setRecursive(true);
        while (walk.next()) {
          final String name = walk.getPathString();
          final FileMode mode = walk.getFileMode(0);
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.