Examples of ReflogReader


Examples of org.eclipse.jgit.lib.ReflogReader

    for (RevCommit commit : commits) {
      assertEquals("first commit", commit.getFullMessage());
      c++;
    }
    assertEquals(1, c);
    ReflogReader reader = db.getReflogReader(Constants.HEAD);
    assertTrue(reader.getLastEntry().getComment()
        .startsWith("commit (amend):"));
    reader = db.getReflogReader(db.getBranch());
    assertTrue(reader.getLastEntry().getComment()
        .startsWith("commit (amend):"));
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.ReflogReader

      return null;
    }

    List<ReflogEntry> entries;
    try {
      ReflogReader reader = repo.getReflogReader(R_STASH);
      entries = reader.getReverseEntries();
    } catch (IOException e) {
      throw new JGitInternalException(JGitText.get().stashDropFailed, e);
    }

    if (stashRefEntry >= entries.size())
View Full Code Here

Examples of org.eclipse.jgit.lib.ReflogReader

    assertTrue(remoteRepository.hasObject(Q_txt));
    assertNotNull("has " + dstName, remoteRepository.getRef(dstName));
    assertEquals(Q, remoteRepository.getRef(dstName).getObjectId());
    fsck(remoteRepository, Q);

    final ReflogReader log = remoteRepository.getReflogReader(dstName);
    assertNotNull("has log for " + dstName);

    final ReflogEntry last = log.getLastEntry();
    assertNotNull("has last entry", last);
    assertEquals(ObjectId.zeroId(), last.getOldId());
    assertEquals(Q, last.getNewId());
    assertEquals("anonymous", last.getWho().getName());
View Full Code Here

Examples of org.eclipse.jgit.lib.ReflogReader

      if (!ObjectId.isId(commitId)) {
        return null;
      }

      try {
        ReflogReader reflogReader = repository.getReflogReader(Constants.HEAD);
        if (reflogReader != null) {
          List<ReflogEntry> lastEntry = reflogReader.getReverseEntries();
          for (ReflogEntry entry : lastEntry) {
            if (entry.getNewId().name().equals(commitId)) {
              CheckoutEntry checkoutEntry = entry.parseCheckout();
              if (checkoutEntry != null) {
                Ref ref = repository.getRef(checkoutEntry.getToBranch());
View Full Code Here

Examples of org.eclipse.jgit.lib.ReflogReader

      return null;
    }

    List<ReflogEntry> entries;
    try {
      ReflogReader reader = repo.getReflogReader(R_STASH);
      entries = reader.getReverseEntries();
    } catch (IOException e) {
      throw new JGitInternalException(JGitText.get().stashDropFailed, e);
    }

    if (stashRefEntry >= entries.size())
View Full Code Here

Examples of org.eclipse.jgit.storage.file.ReflogReader

  public Collection<ReflogEntry> call() throws Exception {
    checkCallable();

    try {
      ReflogReader reader = new ReflogReader(repo, ref);
      return reader.getReverseEntries();
    } catch (IOException e) {
      throw new InvalidRefNameException(MessageFormat.format(
          JGitText.get().cannotRead, ref), e);
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.storage.file.ReflogReader

    }
    if (number < 0)
      throw new RevisionSyntaxException(MessageFormat.format(
          JGitText.get().invalidReflogRevision, time));

    ReflogReader reader = new ReflogReader(this, ref.getName());
    ReflogEntry entry = reader.getReverseEntry(number);
    if (entry == null)
      throw new RevisionSyntaxException(MessageFormat.format(
          JGitText.get().reflogEntryNotFound,
          Integer.valueOf(number), ref.getName()));
View Full Code Here

Examples of org.eclipse.jgit.storage.file.ReflogReader

    return null;
  }

  private String resolveReflogCheckout(int checkoutNo)
      throws IOException {
    List<ReflogEntry> reflogEntries = new ReflogReader(this, Constants.HEAD)
        .getReverseEntries();
    for (ReflogEntry entry : reflogEntries) {
      CheckoutEntry checkout = entry.parseCheckout();
      if (checkout != null)
        if (checkoutNo-- == 1)
View Full Code Here

Examples of org.eclipse.jgit.storage.file.ReflogReader

    } catch (NumberFormatException nfe) {
      throw new RevisionSyntaxException(MessageFormat.format(
          JGitText.get().invalidReflogRevision, time));
    }
    assert number >= 0;
    ReflogReader reader = new ReflogReader(this, ref.getName());
    ReflogEntry entry = reader.getReverseEntry(number);
    if (entry == null)
      throw new RevisionSyntaxException(MessageFormat.format(
          JGitText.get().reflogEntryNotFound,
          Integer.valueOf(number), ref.getName()));
View Full Code Here

Examples of org.eclipse.jgit.storage.file.ReflogReader

    assertEquals("HEAD", ref.getName());
    assertTrue("is detached", !ref.isSymbolic());

    // the branch HEAD referred to is left untouched
    assertEquals(pid, db.resolve("refs/heads/master"));
    ReflogReader reflogReader = new  ReflogReader(db, "HEAD");
    org.eclipse.jgit.storage.file.ReflogReader.Entry e = reflogReader.getReverseEntries().get(0);
    assertEquals(pid, e.getOldId());
    assertEquals(ppid, e.getNewId());
    assertEquals("GIT_COMMITTER_EMAIL", e.getWho().getEmailAddress());
    assertEquals("GIT_COMMITTER_NAME", e.getWho().getName());
    assertEquals(1250379778000L, e.getWho().getWhen().getTime());
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.