本文整理汇总了Java中org.eclipse.jgit.api.PullResult.getRebaseResult方法的典型用法代码示例。如果您正苦于以下问题:Java PullResult.getRebaseResult方法的具体用法?Java PullResult.getRebaseResult怎么用?Java PullResult.getRebaseResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.api.PullResult
的用法示例。
在下文中一共展示了PullResult.getRebaseResult方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import org.eclipse.jgit.api.PullResult; //导入方法依赖的package包/类
private void update(Git git) throws GitAPIException {
PullResult pullResult = git.pull().setRebase(true).call();
RebaseResult rebaseResult = pullResult.getRebaseResult();
if(!pullResult.isSuccessful()) {
if(rebaseResult.getStatus() == RebaseResult.Status.CONFLICTS) {
logger.warn("Git `pull` reported conflicts - will reset and try again next pass!");
git.reset().setMode(ResetCommand.ResetType.HARD).call();
return;
}
logger.warn("Git `pull` was unsuccessful :(");
return;
}
if(rebaseResult.getStatus() == RebaseResult.Status.UP_TO_DATE) {
logger.debug("Git `pull` reported that repository is already up-to-date");
return;
}
logger.debug("Git repo is now at commit '{}'", rebaseResult.getCurrentCommit());
}
示例2: applyBefore
import org.eclipse.jgit.api.PullResult; //导入方法依赖的package包/类
public static Boolean applyBefore(final Git git) {
Boolean result = Boolean.FALSE;
try {
PullCommand pc = git.pull().setRemote(REMOTE).setRebase(Boolean.TRUE);
PullResult pullRes = pc.call();
RebaseResult rr = pullRes.getRebaseResult();
if (rr.getStatus().equals(RebaseResult.Status.UP_TO_DATE) || rr.getStatus().equals(RebaseResult.Status.FAST_FORWARD)) {
result = Boolean.TRUE;
}
if (rr.getStatus().equals(RebaseResult.Status.UNCOMMITTED_CHANGES)) {
PullResult pr = git.pull().call();
if (pr.isSuccessful()) {
result = Boolean.TRUE;
} else {
result = Boolean.FALSE;
}
}
} catch (Exception e) {
logger.error(e.getMessage());
}
return result;
}
示例3: synchronize
import org.eclipse.jgit.api.PullResult; //导入方法依赖的package包/类
protected void synchronize() {
//
// Grab our working repository
//
Path repoPath = ((XacmlAdminUI)getUI()).getUserGitPath();
try {
final Git git = Git.open(repoPath.toFile());
PullResult result = git.pull().call();
FetchResult fetch = result.getFetchResult();
MergeResult merge = result.getMergeResult();
RebaseResult rebase = result.getRebaseResult();
if (result.isSuccessful()) {
//
// TODO add more notification
//
this.textAreaResults.setValue("Successful!");
} else {
//
// TODO
//
this.textAreaResults.setValue("Failed.");
}
} catch (IOException | GitAPIException e) {
e.printStackTrace();
}
this.buttonSynchronize.setCaption("Ok");
}