Package org.eclipse.jgit.treewalk

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


        ent.setObjectId(walk.getObjectId(0));
      }
    });
    assertTrue(editor.commit());
    RevCommit c2 = git.commit().setMessage("second commit").call();
    walk.reset();
    walk.addTree(c1.getTree());
    walk.addTree(c2.getTree());
    List<DiffEntry> diffs = DiffEntry.scan(walk, false);
    assertEquals(1, diffs.size());
    DiffEntry diff = diffs.get(0);
View Full Code Here


    boolean merge = ourMerger.merge(new ObjectId[] { o, t });
    assertTrue(merge);

    final TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
    tw.reset(ourMerger.getResultTreeId());

    assertTrue(tw.next());
    assertEquals("Makefile", tw.getPathString());
    assertCorrectId(treeO, tw);
View Full Code Here

    boolean merge = ourMerger.merge(new ObjectId[] { o, t });
    assertTrue(merge);

    final TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
    tw.reset(ourMerger.getResultTreeId());

    assertTrue(tw.next());
    assertEquals("d/o", tw.getPathString());
    assertCorrectId(treeO, tw);
View Full Code Here

    boolean merge = twm.merge(new ObjectId[] { O, T });
    assertTrue(merge);

    final TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
    tw.reset(twm.getResultTreeId());

    assertTrue(tw.next());
    assertEquals("a", tw.getPathString());
    assertCorrectId(treeO, tw);
View Full Code Here

    boolean merge = twm.merge(new ObjectId[] { B, T });
    assertTrue(merge);

    final TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
    tw.reset(twm.getResultTreeId());

    assertTrue(tw.next());
    assertEquals("a", tw.getPathString());
    assertCorrectId(treeB, tw);
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

      map.set(idBuf, data1);
    }

    RevCommit n = commitNoteMap(map);
    TreeWalk tw = new TreeWalk(reader);
    tw.reset(n.getTree());
    while (tw.next())
      assertFalse("no fan-out subtree", tw.isSubtree());

    for (int i = 254; i < 256; i++) {
      idBuf.setByte(Constants.OBJECT_ID_LENGTH - 1, i);
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

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.