Package org.eclipse.jgit.treewalk

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


        commit = rw.parseCommit(object);
      }

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


    String commitId = null;
    RevWalk rw = new RevWalk(repository);
    TreeWalk tw = new TreeWalk(repository);
    tw.setFilter(PathFilterGroup.createFromStrings(Collections.singleton(path)));
    try {
      tw.reset(commit.getTree());
      while (tw.next()) {
        if (tw.isSubtree() && !path.equals(tw.getPathString())) {
          tw.enterSubtree();
          continue;
        }
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

    }
    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 (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}");
    if (id == null)
      throw new NoHeadException(
View Full Code Here

    boolean served = false;
    RevWalk rw = new RevWalk(repository);
    TreeWalk tw = new TreeWalk(repository);
    try {
      tw.reset();
      tw.addTree(commit.getTree());
      PathFilter f = PathFilter.create(requestedPath);
      tw.setFilter(f);
      tw.setRecursive(true);
      MutableObjectId id = new MutableObjectId();
View Full Code Here

        if (object == null)
          return null;
        RevCommit commit = rw.parseCommit(object);
        tree = commit.getTree();
      }
      tw.reset(tree);
      while (tw.next()) {
        if (tw.isSubtree() && !path.equals(tw.getPathString())) {
          tw.enterSubtree();
          continue;
        }
View Full Code Here

        commit = rw.parseCommit(object);
      }

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

    String commitId = null;
    RevWalk rw = new RevWalk(repository);
    TreeWalk tw = new TreeWalk(repository);
    tw.setFilter(PathFilterGroup.createFromStrings(Collections.singleton(path)));
    try {
      tw.reset(commit.getTree());
      while (tw.next()) {
        if (tw.isSubtree() && !path.equals(tw.getPathString())) {
          tw.enterSubtree();
          continue;
        }
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.