String commitId = origHead != null ? origHead.name() : null;
monitor.beginTask(MessageFormat.format(
JGitText.get().abortingRebase, commitId),
ProgressMonitor.UNKNOWN);
DirCacheCheckout dco;
if (commitId == null)
throw new JGitInternalException(
JGitText.get().abortingRebaseFailedNoOrigHead);
ObjectId id = repo.resolve(commitId);
RevCommit commit = walk.parseCommit(id);
if (result.getStatus().equals(Status.FAILED)) {
RevCommit head = walk.parseCommit(repo.resolve(Constants.HEAD));
dco = new DirCacheCheckout(repo, head.getTree(),
repo.lockDirCache(), commit.getTree());
} else {
dco = new DirCacheCheckout(repo, repo.lockDirCache(),
commit.getTree());
}
dco.setFailOnConflict(false);
dco.checkout();
walk.release();
} finally {
monitor.endTask();
}
try {