本文整理了Java中org.eclipse.jgit.api.Git.reflog()
方法的一些代码示例,展示了Git.reflog()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Git.reflog()
方法的具体详情如下:
包路径:org.eclipse.jgit.api.Git
类名称:Git
方法名:reflog
[英]Return a command object to execute a reflog command
[中]返回命令对象以执行reflog命令
代码示例来源:origin: jphp-group/jphp
@Signature
public Memory reflog(Memory ref) throws GitAPIException {
ReflogCommand command = getWrappedObject().reflog();
if (ref.isNotNull()) {
command.setRef(ref.toString());
}
Collection<ReflogEntry> call = command.call();
return GitUtils.valueOfReflogEntries(call);
}
代码示例来源:origin: centic9/jgit-cookbook
private static void listReflog(Repository repository, Ref ref) throws GitAPIException {
/*
* Ref head = repository.getRef(ref.getName());
* RevWalk walk = new RevWalk(repository);
* RevCommit commit = walk.parseCommit(head.getObjectId());
*/
try (Git git = new Git(repository)) {
Collection<ReflogEntry> call = git.reflog().setRef(ref.getName()).call();
for (ReflogEntry reflog : call) {
System.out.println("Reflog: " + reflog);
}
}
}
}
代码示例来源:origin: centic9/jgit-cookbook
private static void listReflog(Repository repository, Ref ref) throws GitAPIException {
/*
* Ref head = repository.getRef(ref.getName());
* RevWalk walk = new RevWalk(repository);
* RevCommit commit = walk.parseCommit(head.getObjectId());
*/
try (Git git = new Git(repository)) {
Collection<ReflogEntry> call = git.reflog().setRef(ref.getName()).call();
for (ReflogEntry reflog : call) {
System.out.println("Reflog: " + reflog);
}
}
}
}
代码示例来源:origin: org.eclipse.egit/ui
public Object[] getElements(Object inputElement) {
if (inputElement instanceof ReflogInput) {
ReflogInput input = (ReflogInput) inputElement;
ReflogCommand command = new Git(input.repository).reflog();
command.setRef(input.ref);
try {
return command.call().toArray();
} catch (Exception e) {
Activator.logError("Error running reflog command", e); //$NON-NLS-1$
}
}
return new Object[0];
}
代码示例来源:origin: com.madgag/org.eclipse.jgit.pgm
@Override
protected void run() throws Exception {
ReflogCommand cmd = new Git(db).reflog();
if (ref != null)
cmd.setRef(ref);
Collection<ReflogEntry> entries = cmd.call();
int i = 0;
for (ReflogEntry entry : entries) {
outw.println(toString(entry, i++));
}
}
内容来源于网络,如有侵权,请联系作者删除!