Package org.eclipse.jgit.treewalk

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


    }
    boolean success = false;
    RevWalk rw = new RevWalk(repository);
    TreeWalk tw = new TreeWalk(repository);
    try {
      tw.reset();
      tw.addTree(commit.getTree());
      ZipArchiveOutputStream zos = new ZipArchiveOutputStream(os);
      zos.setComment("Generated by Gitblit");
      if (!StringUtils.isEmpty(basePath)) {
        PathFilter f = PathFilter.create(basePath);
View Full Code Here


    }
    boolean success = false;
    RevWalk rw = new RevWalk(repository);
    TreeWalk tw = new TreeWalk(repository);
    try {
      tw.reset();
      tw.addTree(commit.getTree());
      TarArchiveOutputStream tos = new TarArchiveOutputStream(cos);
      tos.setAddPaxHeadersForNonAsciiNames(true);
      tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
      if (!StringUtils.isEmpty(basePath)) {
View Full Code Here

      }
      if (matchingPath == null) {
        // path not in commit
        // manually locate path in tree
        TreeWalk tw = new TreeWalk(r);
        tw.reset();
        tw.setRecursive(true);
        try {
          tw.addTree(commit.getTree());
          tw.setFilter(PathFilterGroup.createFromStrings(Collections.singleton(path)));
          while (tw.next()) {
View Full Code Here

      }
    });
    dce.finish();

    TreeWalk ret = new TreeWalk((ObjectReader) null);
    ret.reset();
    ret.setRecursive(true);
    ret.addTree(new DirCacheIterator(dc));
    ret.next();
    return ret;
  }
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));
        if (!paths.isEmpty())
          walk.setFilter(PathFilterGroup.createFromStrings(paths));

        while (walk.next()) {
          final String name = pfx + walk.getPathString();
View Full Code Here

  private List<String> paths = new ArrayList<String>();

  @Override
  protected void run() throws Exception {
    final TreeWalk walk = new TreeWalk(db);
    walk.reset(); // drop the first empty tree, which we do not need here
    if (paths.size() > 0)
      walk.setFilter(PathFilterGroup.createFromStrings(paths));
    walk.setRecursive(recursive);
    walk.addTree(tree);
View Full Code Here

  }

  private void show(RevTree obj) throws MissingObjectException,
      IncorrectObjectTypeException, CorruptObjectException, IOException {
    final TreeWalk walk = new TreeWalk(db);
    walk.reset();
    walk.addTree(obj);

    while (walk.next()) {
      outw.print(walk.getPathString());
      final FileMode mode = walk.getFileMode(0);
View Full Code Here

  public RevObject get(final RevTree tree, final String path)
      throws Exception {
    final TreeWalk tw = new TreeWalk(pool.getObjectReader());
    tw.setFilter(PathFilterGroup.createFromStrings(Collections
        .singleton(path)));
    tw.reset(tree);
    while (tw.next()) {
      if (tw.isSubtree() && !path.equals(tw.getPathString())) {
        tw.enterSubtree();
        continue;
      }
View Full Code Here

      b.add(ents[i]);
    b.finish();

    final TreeWalk tw = new TreeWalk(db);
    for (int victimIdx = 0; victimIdx < paths.length; victimIdx++) {
      tw.reset();
      tw.addTree(new DirCacheIterator(dc));
      tw.setFilter(PathFilterGroup.createFromStrings(Collections
          .singleton(paths[victimIdx])));
      tw.setRecursive(tw.getFilter().shouldBeRecursive());
      assertTrue(tw.next());
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.