}
private void checkParameters() throws WrongRepositoryStateException {
if (this.operation == Operation.PROCESS_STEPS) {
if (rebaseState.getFile(DONE).exists())
throw new WrongRepositoryStateException(MessageFormat.format(
JGitText.get().wrongRepositoryState, repo
.getRepositoryState().name()));
}
if (this.operation != Operation.BEGIN) {
// these operations are only possible while in a rebasing state
switch (repo.getRepositoryState()) {
case REBASING_INTERACTIVE:
case REBASING:
case REBASING_REBASING:
case REBASING_MERGE:
break;
default:
throw new WrongRepositoryStateException(MessageFormat.format(
JGitText.get().wrongRepositoryState, repo
.getRepositoryState().name()));
}
} else
switch (repo.getRepositoryState()) {
case SAFE:
if (this.upstreamCommit == null)
throw new JGitInternalException(MessageFormat
.format(JGitText.get().missingRequiredParameter,
"upstream"));
return;
default:
throw new WrongRepositoryStateException(MessageFormat.format(
JGitText.get().wrongRepositoryState, repo
.getRepositoryState().name()));
}
}