org.eclipse.jgit.lib.Repository.getReflogReader()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中org.eclipse.jgit.lib.Repository.getReflogReader方法的一些代码示例,展示了Repository.getReflogReader的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.getReflogReader方法的具体详情如下:
包路径:org.eclipse.jgit.lib.Repository
类名称:Repository
方法名:getReflogReader

Repository.getReflogReader介绍

[英]Get the reflog reader
[中]获取reflog阅读器

代码示例

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * {@inheritDoc}
 * <p>
 * Run the reflog command
 */
@Override
public Collection<ReflogEntry> call() throws GitAPIException,
    InvalidRefNameException {
  checkCallable();
  try {
    ReflogReader reader = repo.getReflogReader(ref);
    if (reader == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, ref));
    return reader.getReverseEntries();
  } catch (IOException e) {
    throw new InvalidRefNameException(MessageFormat.format(
        JGitText.get().cannotRead, ref), e);
  }
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

@Nullable
private String resolveReflogCheckout(int checkoutNo)
    throws IOException {
  ReflogReader reader = getReflogReader(Constants.HEAD);
  if (reader == null) {
    return null;
  }
  List<ReflogEntry> reflogEntries = reader.getReverseEntries();
  for (ReflogEntry entry : reflogEntries) {
    CheckoutEntry checkout = entry.parseCheckout();
    if (checkout != null)
      if (checkoutNo-- == 1)
        return checkout.getFromBranch();
  }
  return null;
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

private RevCommit resolveReflog(RevWalk rw, Ref ref, String time)
    throws IOException {
  int number;
  try {
    number = Integer.parseInt(time);
  } catch (NumberFormatException nfe) {
    throw new RevisionSyntaxException(MessageFormat.format(
        JGitText.get().invalidReflogRevision, time));
  }
  assert number >= 0;
  ReflogReader reader = getReflogReader(ref.getName());
  if (reader == null) {
    throw new RevisionSyntaxException(
        MessageFormat.format(JGitText.get().reflogEntryNotFound,
            Integer.valueOf(number), ref.getName()));
  }
  ReflogEntry entry = reader.getReverseEntry(number);
  if (entry == null)
    throw new RevisionSyntaxException(MessageFormat.format(
        JGitText.get().reflogEntryNotFound,
        Integer.valueOf(number), ref.getName()));
  return rw.parseCommit(entry.getNewId());
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

ReflogReader reader = repo.getReflogReader(R_STASH);
if (reader == null) {
  throw new RefNotFoundException(MessageFormat

代码示例来源:origin: beijunyi/ParallelGit

@Nonnull
public static List<ReflogEntry> getRefLogs(String ref, int max, Repository repository) throws IOException {
 ReflogReader reader = repository.getReflogReader(ref);
 return reader != null ? reader.getReverseEntries(max) : Collections.<ReflogEntry>emptyList();
}

代码示例来源:origin: com.beijunyi/parallelgit-utils

@Nonnull
public static List<ReflogEntry> getRefLogs(String ref, int max, Repository repository) throws IOException {
 ReflogReader reader = repository.getReflogReader(ref);
 return reader != null ? reader.getReverseEntries(max) : Collections.<ReflogEntry>emptyList();
}

代码示例来源:origin: com.beijunyi.parallelgit/parallelgit-utils

@Nonnull
public static List<ReflogEntry> getRefLogs(@Nonnull String branch, int max, @Nonnull Repository repository) throws IOException {
 ReflogReader reader = repository.getReflogReader(ensureBranchRefName(branch));
 return reader != null ? reader.getReverseEntries(max) : Collections.<ReflogEntry>emptyList();
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * Run the reflog command
 *
 * @throws GitAPIException
 * @throws InvalidRefNameException
 */
public Collection<ReflogEntry> call() throws GitAPIException,
    InvalidRefNameException {
  checkCallable();
  try {
    ReflogReader reader = repo.getReflogReader(ref);
    if (reader == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, ref));
    return reader.getReverseEntries();
  } catch (IOException e) {
    throw new InvalidRefNameException(MessageFormat.format(
        JGitText.get().cannotRead, ref), e);
  }
}

代码示例来源:origin: berlam/github-bucket

/**
 * {@inheritDoc}
 * <p>
 * Run the reflog command
 */
@Override
public Collection<ReflogEntry> call() throws GitAPIException,
    InvalidRefNameException {
  checkCallable();
  try {
    ReflogReader reader = repo.getReflogReader(ref);
    if (reader == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, ref));
    return reader.getReverseEntries();
  } catch (IOException e) {
    throw new InvalidRefNameException(MessageFormat.format(
        JGitText.get().cannotRead, ref), e);
  }
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

@Nullable
private String resolveReflogCheckout(int checkoutNo)
    throws IOException {
  ReflogReader reader = getReflogReader(Constants.HEAD);
  if (reader == null) {
    return null;
  }
  List<ReflogEntry> reflogEntries = reader.getReverseEntries();
  for (ReflogEntry entry : reflogEntries) {
    CheckoutEntry checkout = entry.parseCheckout();
    if (checkout != null)
      if (checkoutNo-- == 1)
        return checkout.getFromBranch();
  }
  return null;
}

代码示例来源:origin: berlam/github-bucket

@Nullable
private String resolveReflogCheckout(int checkoutNo)
    throws IOException {
  ReflogReader reader = getReflogReader(Constants.HEAD);
  if (reader == null) {
    return null;
  }
  List<ReflogEntry> reflogEntries = reader.getReverseEntries();
  for (ReflogEntry entry : reflogEntries) {
    CheckoutEntry checkout = entry.parseCheckout();
    if (checkout != null)
      if (checkoutNo-- == 1)
        return checkout.getFromBranch();
  }
  return null;
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

private RevCommit resolveReflog(RevWalk rw, Ref ref, String time)
    throws IOException {
  int number;
  try {
    number = Integer.parseInt(time);
  } catch (NumberFormatException nfe) {
    throw new RevisionSyntaxException(MessageFormat.format(
        JGitText.get().invalidReflogRevision, time));
  }
  assert number >= 0;
  ReflogReader reader = getReflogReader(ref.getName());
  if (reader == null) {
    throw new RevisionSyntaxException(
        MessageFormat.format(JGitText.get().reflogEntryNotFound,
            Integer.valueOf(number), ref.getName()));
  }
  ReflogEntry entry = reader.getReverseEntry(number);
  if (entry == null)
    throw new RevisionSyntaxException(MessageFormat.format(
        JGitText.get().reflogEntryNotFound,
        Integer.valueOf(number), ref.getName()));
  return rw.parseCommit(entry.getNewId());
}

代码示例来源:origin: berlam/github-bucket

private RevCommit resolveReflog(RevWalk rw, Ref ref, String time)
    throws IOException {
  int number;
  try {
    number = Integer.parseInt(time);
  } catch (NumberFormatException nfe) {
    throw new RevisionSyntaxException(MessageFormat.format(
        JGitText.get().invalidReflogRevision, time));
  }
  assert number >= 0;
  ReflogReader reader = getReflogReader(ref.getName());
  if (reader == null) {
    throw new RevisionSyntaxException(
        MessageFormat.format(JGitText.get().reflogEntryNotFound,
            Integer.valueOf(number), ref.getName()));
  }
  ReflogEntry entry = reader.getReverseEntry(number);
  if (entry == null)
    throw new RevisionSyntaxException(MessageFormat.format(
        JGitText.get().reflogEntryNotFound,
        Integer.valueOf(number), ref.getName()));
  return rw.parseCommit(entry.getNewId());
}

代码示例来源:origin: org.eclipse.egit/ui

List<ReflogEntry> reflogEntries = repository.getReflogReader(
    Constants.HEAD).getReverseEntries();
for (ReflogEntry entry : reflogEntries) {

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

ReflogReader reader = repo.getReflogReader(R_STASH);
if (reader == null) {
  throw new RefNotFoundException(MessageFormat

代码示例来源:origin: berlam/github-bucket

ReflogReader reader = repo.getReflogReader(R_STASH);
if (reader == null) {
  throw new RefNotFoundException(MessageFormat

相关文章

Repository类方法