UIText.CommitAction_amendNotPossible);
return false;
}
}
CommitDialog commitDialog = new CommitDialog(shell);
commitDialog.setAmending(amending);
commitDialog.setAmendAllowed(amendAllowed);
commitDialog.setFiles(repo, files, indexDiff);
commitDialog.setPreselectedFiles(getSelectedFiles());
commitDialog.setPreselectAll(preselectAll);
commitDialog.setAuthor(commitHelper.getAuthor());
commitDialog.setCommitter(commitHelper.getCommitter());
commitDialog.setAllowToChangeSelection(!commitHelper.isMergedResolved && !commitHelper.isCherryPickResolved);
commitDialog.setCommitMessage(commitHelper.getCommitMessage());
if (commitDialog.open() != IDialogConstants.OK_ID)
return false;
final CommitOperation commitOperation;
try {
commitOperation= new CommitOperation(
repo,
commitDialog.getSelectedFiles(), notTracked, commitDialog.getAuthor(),
commitDialog.getCommitter(), commitDialog.getCommitMessage());
} catch (CoreException e1) {
Activator.handleError(UIText.CommitUI_commitFailed, e1, true);
return false;
}
if (commitDialog.isAmending())
commitOperation.setAmending(true);
commitOperation.setComputeChangeId(commitDialog.getCreateChangeId());
commitOperation.setCommitAll(commitHelper.isMergedResolved);
if (commitHelper.isMergedResolved)
commitOperation.setRepository(repo);
Job commitJob = new CommitJob(repo, commitOperation).
setPushUpstream(commitDialog.isPushRequested());
commitJob.schedule();
return true;
}