本文整理了Java中org.eclipse.jgit.lib.Repository.getReflogReader
方法的一些代码示例,展示了Repository.getReflogReader
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.getReflogReader
方法的具体详情如下:
包路径:org.eclipse.jgit.lib.Repository
类名称: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
内容来源于网络,如有侵权,请联系作者删除!