Package org.eclipse.jgit.revwalk

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


      throws MissingObjectException, IncorrectObjectTypeException,
      IOException {
    final RevWalk rw = new RevWalk(clonedRepo);
    final RevCommit commit;
    try {
      commit = rw.parseCommit(ref.getObjectId());
    } finally {
      rw.release();
    }
    return commit;
  }
View Full Code Here


      if (startPointFullName == null) {
        String baseCommit;
        if (startCommit != null)
          baseCommit = startCommit.getShortMessage();
        else {
          RevCommit commit = revWalk.parseCommit(repo
              .resolve(startPoint));
          baseCommit = commit.getShortMessage();
        }
        if (exists)
          refLogMessage = "branch: Reset start-point to commit "
View Full Code Here

            MessageFormat.format(JGitText.get().cannotRead, ref),
            e);
      }
      RevWalk rw = new RevWalk(repo);
      try {
        commit = rw.parseCommit(commitId);
      } catch (IOException e) {
        throw new JGitInternalException(
            MessageFormat.format(
            JGitText.get().cannotReadCommit, commitId.toString()),
            e);
View Full Code Here

          ObjectId commitId = odi.insert(commit);
          odi.flush();

          RevWalk revWalk = new RevWalk(repo);
          try {
            RevCommit revCommit = revWalk.parseCommit(commitId);
            RefUpdate ru = repo.updateRef(Constants.HEAD);
            ru.setNewObjectId(commitId);
            if (reflogComment != null) {
              ru.setRefLogMessage(reflogComment, false);
            } else {
View Full Code Here

        throw new RefNotFoundException(MessageFormat.format(JGitText
            .get().refNotResolved, name));

      RevWalk revWalk = new RevWalk(repo);
      AnyObjectId headId = headRef.getObjectId();
      RevCommit headCommit = headId == null ? null : revWalk
          .parseCommit(headId);
      RevCommit newCommit = revWalk.parseCommit(branch);
      RevTree headTree = headCommit == null ? null : headCommit.getTree();
      DirCacheCheckout dco = new DirCacheCheckout(repo, headTree,
          repo.lockDirCache(), newCommit.getTree());
View Full Code Here

      RevWalk revWalk = new RevWalk(repo);
      AnyObjectId headId = headRef.getObjectId();
      RevCommit headCommit = headId == null ? null : revWalk
          .parseCommit(headId);
      RevCommit newCommit = revWalk.parseCommit(branch);
      RevTree headTree = headCommit == null ? null : headCommit.getTree();
      DirCacheCheckout dco = new DirCacheCheckout(repo, headTree,
          repo.lockDirCache(), newCommit.getTree());
      dco.setFailOnConflict(true);
      try {
View Full Code Here

      TreeWalk startWalk = new TreeWalk(revWalk.getObjectReader());
      startWalk.setRecursive(true);
      startWalk.setFilter(PathFilterGroup.createFromStrings(paths));
      boolean checkoutIndex = startCommit == null && startPoint == null;
      if (!checkoutIndex)
        startWalk.addTree(revWalk.parseCommit(getStartPoint())
            .getTree());
      else
        startWalk.addTree(new DirCacheIterator(dc));

      final File workTree = repo.getWorkTree();
View Full Code Here

            clone.setProgressMonitor(monitor);
          submoduleRepo = clone.call().getRepository();
        }

        RevWalk walk = new RevWalk(submoduleRepo);
        RevCommit commit = walk.parseCommit(generator.getObjectId());

        String update = generator.getConfigUpdate();
        if (ConfigConstants.CONFIG_KEY_MERGE.equals(update)) {
          MergeCommand merge = new MergeCommand(submoduleRepo);
          merge.include(commit);
View Full Code Here

    final RevWalk walk = new RevWalk(repo);
    walk.setRetainBody(true);
    try {
      for (ReflogEntry entry : stashEntries)
        try {
          stashCommits.add(walk.parseCommit(entry.getNewId()));
        } catch (IOException e) {
          throw new JGitInternalException(MessageFormat.format(
              JGitText.get().cannotReadCommit, entry.getNewId()),
              e);
        }
View Full Code Here

      // get the head commit
      Ref headRef = repo.getRef(Constants.HEAD);
      if (headRef == null)
        throw new NoHeadException(
            JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);
      RevCommit headCommit = revWalk.parseCommit(headRef.getObjectId());

      newHead = headCommit;

      // loop through all refs to be cherry-picked
      for (Ref src : commits) {
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.