Examples of parseCommit()


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

    RevCommit notesCommit = null;
    try {
      Ref ref = repo.getRef(notesRef);
      // if we have a notes ref, use it
      if (ref != null) {
        notesCommit = walk.parseCommit(ref.getObjectId());
        map = NoteMap.read(walk.getObjectReader(), notesCommit);
      }
      map.set(id, null, inserter);
      commitNoteMap(walk, map, notesCommit, inserter,
          "Notes removed by 'git notes remove'");
View Full Code Here

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

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

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

      // 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

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

        // get the commit to be cherry-picked
        // handle annotated tags
        ObjectId srcObjectId = src.getPeeledObjectId();
        if (srcObjectId == null)
          srcObjectId = src.getObjectId();
        RevCommit srcCommit = revWalk.parseCommit(srcObjectId);

        // get the parent of the commit to cherry-pick
        if (srcCommit.getParentCount() != 1) {
          throw new MultipleParentsNotAllowedException(
              JGitText.get().canOnlyCherryPickCommitsWithOneParent);
View Full Code Here

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

        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

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

      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

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

      if (startCommit != null || startPoint != null) {
        DirCacheEditor editor = dc.editor();
        TreeWalk startWalk = new TreeWalk(revWalk.getObjectReader());
        startWalk.setRecursive(true);
        startWalk.setFilter(treeWalk.getFilter());
        startWalk.addTree(revWalk.parseCommit(getStartPoint())
            .getTree());
        while (startWalk.next()) {
          final ObjectId blobId = startWalk.getObjectId(0);
          editor.add(new PathEdit(startWalk.getPathString()) {
View Full Code Here

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

            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

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

    RevCommit notesCommit = null;
    try {
      Ref ref = repo.getRef(notesRef);
      // if we have a notes ref, use it
      if (ref != null) {
        notesCommit = walk.parseCommit(ref.getObjectId());
        map = NoteMap.read(walk.getObjectReader(), notesCommit);
      }
      return map.getNote(id);
    } catch (IOException e) {
      throw new JGitInternalException(e.getMessage(), e);
View Full Code Here

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

    RevCommit notesCommit = null;
    try {
      Ref ref = repo.getRef(notesRef);
      // if we have a notes ref, use it
      if (ref != null) {
        notesCommit = walk.parseCommit(ref.getObjectId());
        map = NoteMap.read(walk.getObjectReader(), notesCommit);
      }
      map.set(id, message, inserter);
      commitNoteMap(walk, map, notesCommit, inserter,
          "Notes added by 'git notes add'");
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.