Examples of parseTree()


Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

      throws IOException {
    assertHaveRepository();

    RevWalk rw = new RevWalk(reader);
    RevTree aTree = a != null ? rw.parseTree(a) : null;
    RevTree bTree = b != null ? rw.parseTree(b) : null;
    return scan(aTree, bTree);
  }

  /**
   * Determine the differences between two trees.
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

    ObjectReader or = db.newObjectReader();
    try {
      final MutableObjectId id = new MutableObjectId();
      RevWalk rw = new RevWalk(or);
      TreeWalk tw = new TreeWalk(or);
      tw.reset(rw.parseTree(db.resolve(Constants.HEAD)));
      tw.setRecursive(true);

      while (tw.next()) {
        FileMode fm = tw.getFileMode(0);
        if (!FileMode.REGULAR_FILE.equals(fm)
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

          ResolveMerger ixMerger = (ResolveMerger) strategy.newMerger(repo, true);
          ixMerger.setCommitNames(new String[] { "stashed HEAD", "HEAD", "stashed index" });
          ixMerger.setBase(stashHeadCommit);
          boolean ok = ixMerger.merge(headCommit, stashIndexCommit);
          if (ok) {
            resetIndex(revWalk.parseTree(ixMerger.getResultTreeId()));
          } else {
            throw new StashApplyFailureException(JGitText.get().stashApplyConflict);
          }
        }
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

          untrackedMerger.setCommitNames(new String[] { "stashed HEAD", "HEAD", "untracked files" }); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
          untrackedMerger.setBase(stashHeadCommit);
          boolean ok = untrackedMerger.merge(stashHeadCommit, untrackedCommit);
          if (ok)
            try {
              RevTree untrackedTree = revWalk.parseTree(untrackedMerger.getResultTreeId());
              resetUntracked(untrackedTree);
            } catch (CheckoutConflictException e) {
              throw new StashApplyFailureException(JGitText.get().stashApplyConflict);
            }
          else
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

    try {
      final RevWalk rw = new RevWalk(reader);
      final RevCommit bCommit = rw.parseCommit(pl.getNewId());

      if (pl.getOldId() != null) {
        aTree = rw.parseTree(pl.getOldId());
      } else {
        // Octopus merge with unknown automatic merge result, since the
        // web UI returns no files to match against, just fail.
        return engine.fail();
      }
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

      throws IOException {

    Ref gitHead = repo.getRef(ref);
    RevWalk revWalk = new RevWalk(repo);
    RevCommit gitCommit = revWalk.parseCommit(gitHead.getObjectId());
    RevTree gitTree = revWalk.parseTree(gitCommit.getTree().getId());
    CanonicalTreeParser treeParser = new CanonicalTreeParser();
    ObjectReader newObjectReader = repo.newObjectReader();

    try {
      treeParser.reset(newObjectReader, gitTree.getId());
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

    try {
      treeWalk.addTree(new DirCacheIterator(repo.readDirCache()));
      ObjectId headID = repo.resolve(Constants.HEAD);
      if (headID != null) {
        revWalk = new RevWalk(repo);
        treeWalk.addTree(revWalk.parseTree(headID));
        revWalk.dispose();
        revWalk = null;
      }

      treeWalk.setFilter(TreeFilter.ANY_DIFF);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

        if (objectId == null) {
            return false;
        }

        RevWalk revWalk = new RevWalk(repository);
        RevTree revTree = revWalk.parseTree(objectId);
        TreeWalk treeWalk = new TreeWalk(repository);
        treeWalk.addTree(revTree);

        treeWalk.setRecursive(true);
        treeWalk.setFilter(PathFilter.create(path));
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

            Logger.debug("GitRepository : init Project - No Head commit");
            return null;
        }

        RevWalk revWalk = new RevWalk(repository);
        RevTree revTree = revWalk.parseTree(headCommit);
        TreeWalk treeWalk = new TreeWalk(repository);
        treeWalk.addTree(revTree);

        if (path.isEmpty()) {
            return treeAsJson(path, treeWalk, headCommit);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()

        TreeWalk treeWalk = new TreeWalk(repository);
        RevWalk walk = new RevWalk(repository);
        try {
            ObjectId from = repository.resolve(fromBranch);
            ObjectId to = repository.resolve(toBranch);
            RevTree fromTree = walk.parseTree(from);
            RevTree toTree = walk.parseTree(to);

            treeWalk.addTree(toTree);
            treeWalk.addTree(fromTree);
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.