Examples of RevTag


Examples of org.eclipse.jgit.revwalk.RevTag

          } catch (IOException e) {
            continue;
          }
          if (o.has(WANT) || !(o instanceof RevTag))
            continue;
          final RevTag t = (RevTag) o;
          if (!pw.willInclude(t) && pw.willInclude(t.getObject()))
            pw.addObject(t);
        }
      }
      pw.writePack(pm, NullProgressMonitor.INSTANCE, packOut);
    } finally {
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

    long timeof(RevObject o) {
      if (o instanceof RevCommit)
        return ((RevCommit) o).getCommitTime();
      if (o instanceof RevTag) {
        RevTag tag = (RevTag) o;
        PersonIdent who = tag.getTaggerIdent();
        return who != null ? who.getWhen().getTime() : 0;
      }
      return 0;
    }
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

        this.repository.commitCache.put(this.repository.headObject, head);

        JGitRepository repo = spy(this.repository);

        Map<String, RevTag> rawTags = new HashMap<String, RevTag>();
        RevTag rawTag = this.createTag("2.0.0", head.getName());
        rawTags.put(head.getName(), rawTag);
        doReturn(rawTags).when(repo).getRawTags();

        Map<String, GitTag> tags = new HashMap<String, GitTag>();
        tags.put(head.getName(), new JGitTag(rawTag));
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

        this.repository.commitCache.put(this.repository.headObject, head);

        JGitRepository repo = spy(this.repository);

        Map<String, RevTag> rawTags = new HashMap<String, RevTag>();
        RevTag rawTag = this.createTag("2.0.0", head_2.getName());
        rawTags.put(head_2.getName(), rawTag);
        doReturn(rawTags).when(repo).getRawTags();

        Map<String, GitTag> tags = new HashMap<String, GitTag>();
        tags.put(head_2.getName(), new JGitTag(rawTag));
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

    }

    @Test
    public void testGetTags() throws Exception {
        Map<String, RevTag> rawTags = new HashMap<String, RevTag>();
        RevTag rawTag1 = this.createTag();
        rawTags.put("1.0.0", rawTag1);
        RevTag rawTag2 = this.createTag();
        rawTags.put("2.0.0", rawTag2);

        JGitRepository repo = spy(this.repository);
        doReturn(rawTags).when(repo).getRawTags();
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

        Ref tagRef2 = mock(Ref.class);
        tagRefs.put("1.0.0", tagRef1);
        tagRefs.put("2.0.0", tagRef2);
        when(this.repo.getTags()).thenReturn(tagRefs);

        RevTag tag1 = this.createTag();
        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);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

public class JGitTagTest {

    @Test
    public void test() throws Exception {
        RevTag rawTag = RevTag.parse(("object 4b825dc642cb6eb9a060e54bf8d69288fbee4904\n" +
                "type commit\n" +
                "tag 1.0.0\n" +
                "tagger Sebastian Staudt <koraktor@gmail.com> 1275131880 +0200\n" +
                "\n" +
                "Version 1.0.0\n").getBytes());
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

        Map<String, RevTag> tags = new HashMap<String, RevTag>();

        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);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

      needs(p);
    obj.add(COMPLETE);
  }

  private void processTag(final RevObject obj) {
    final RevTag tag = (RevTag) obj;
    needs(tag.getObject());
    obj.add(COMPLETE);
  }
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevTag

    if (branch.startsWith(Constants.R_REFS)) {
      RevCommit commit = revWalk.parseCommit(repository.resolve(branch));
      return commit.getId().getName();
    }
    if (branch.startsWith(Constants.R_TAGS)) {
      RevTag tag = revWalk.parseTag(repository.resolve(branch));
      return tag.getObject().getId().name();
    }
    throw new IllegalStateException("Can't resolve commit");
  }
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.