public RevCommit call() throws NoHeadException, NoMessageException,
UnmergedPathException, ConcurrentRefUpdateException,
JGitInternalException, WrongRepositoryStateException {
checkCallable();
RepositoryState state = repo.getRepositoryState();
if (!state.canCommit())
throw new WrongRepositoryStateException(MessageFormat.format(
JGitText.get().cannotCommitOnARepoWithState, state.name()));
processOptions(state);
try {
if (all && !repo.isBare() && repo.getWorkTree() != null) {
Git git = new Git(repo);