Package org.eclipse.jgit.revwalk

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


    RevWalk rw = new RevWalk(getRepository());
    try {
      RevObject obj = rw.parseAny(leaf.getObjectId());
      if (obj instanceof RevTag) {
        return new ObjectIdRef.PeeledTag(leaf.getStorage(), leaf
            .getName(), leaf.getObjectId(), rw.peel(obj).copy());
      } else {
        return new ObjectIdRef.PeeledNonTag(leaf.getStorage(), leaf
            .getName(), leaf.getObjectId());
      }
    } finally {
View Full Code Here


        RevTag tag2 = this.createTag();
        RevCommit commit1 = this.createCommit();
        RevObject commit2 = this.createCommit();
        when(tagRef1.getObjectId()).thenReturn(tag1);
        when(revWalk.parseTag(tag1)).thenReturn(tag1);
        when(revWalk.peel(tag1)).thenReturn(commit1);
        when(tagRef2.getObjectId()).thenReturn(tag2);
        when(revWalk.parseTag(tag2)).thenReturn(tag2);
        when(revWalk.peel(tag2)).thenReturn(commit2);

        Map<String, RevTag> tags = new HashMap<String, RevTag>();
View Full Code Here

        when(tagRef1.getObjectId()).thenReturn(tag1);
        when(revWalk.parseTag(tag1)).thenReturn(tag1);
        when(revWalk.peel(tag1)).thenReturn(commit1);
        when(tagRef2.getObjectId()).thenReturn(tag2);
        when(revWalk.parseTag(tag2)).thenReturn(tag2);
        when(revWalk.peel(tag2)).thenReturn(commit2);

        Map<String, RevTag> tags = new HashMap<String, RevTag>();
        tags.put(commit1.getName(), tag1);
        tags.put(commit2.getName(), tag2);
View Full Code Here

        try {
            for (Map.Entry<String, Ref> tag : tagRefs.entrySet()) {
                try {
                    RevTag revTag = revWalk.parseTag(tag.getValue().getObjectId());
                    RevObject object = revWalk.peel(revTag);
                    if (!(object instanceof RevCommit)) {
                        continue;
                    }
                    tags.put(object.getName(), revTag);
                } catch(IncorrectObjectTypeException e) {
View Full Code Here

          refLogMessage = "branch: Reset start-point to branch "
              + startPointFullName; // TODO
        else
          refLogMessage = "branch: Created from branch " + baseBranch;
      } else {
        startAt = revWalk.peel(revWalk.parseAny(startAt));
        if (exists)
          refLogMessage = "branch: Reset start-point to tag "
              + startPointFullName;
        else
          refLogMessage = "branch: Created from tag "
View Full Code Here

    RevWalk rw = new RevWalk(getRepository());
    try {
      RevObject obj = rw.parseAny(leaf.getObjectId());
      if (obj instanceof RevTag) {
        return new ObjectIdRef.PeeledTag(leaf.getStorage(), leaf
            .getName(), leaf.getObjectId(), rw.peel(obj).copy());
      } else {
        return new ObjectIdRef.PeeledNonTag(leaf.getStorage(), leaf
            .getName(), leaf.getObjectId());
      }
    } finally {
View Full Code Here

      if (obj instanceof RevTag) {
        return new ObjectIdRef.PeeledTag(
            leaf.getStorage(),
            leaf.getName(),
            leaf.getObjectId(),
            rw.peel(obj).copy());
      } else {
        return new ObjectIdRef.PeeledNonTag(
            leaf.getStorage(),
            leaf.getName(),
            leaf.getObjectId());
View Full Code Here

        d.getTargetBuilder().setChunkKey(oKey.asString());
      else
        d.getTargetBuilder().clearChunkKey();

      if (obj instanceof RevTag) {
        ObjectId pId = rw.peel(obj);
        d.getPeeledBuilder().setObjectName(pId.name());

        ChunkKey pKey = ctx.findChunk(pId);
        if (pKey != null)
          d.getPeeledBuilder().setChunkKey(pKey.asString());
View Full Code Here

      // both RevCommits must be allocated using same RevWalk instance,
      // otherwise isMergedInto returns wrong result!
      RevCommit current = revWalk.parseCommit(commit);
      // tags can point to any object, we only want tags pointing at
      // commits
      RevObject any = revWalk.peel(revWalk.parseAny(ref.getObjectId()));
      if (!(any instanceof RevCommit))
        continue;
      RevCommit newTag = (RevCommit) any;
      if (newTag.getId().equals(commit))
        continue;
View Full Code Here

    try {
      Map<String, Ref> tagRefs = getRefs(repo, Constants.R_TAGS);
      for (Ref tagRef : tagRefs.values()) {
        ObjectId objectId = tagRef.getLeaf().getObjectId();
        RevObject revObject = walk.parseAny(objectId);
        RevObject peeledObject = walk.peel(revObject);
        TagNode tagNode = createTagNode(parentNode, repo, tagRef,
            revObject, peeledObject);
        nodes.add(tagNode);
      }
    } catch (IOException e) {
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.