Source:
private void commit(boolean pushUpstream) { if (!isCommitWithoutFilesAllowed()) { MessageDialog.openError(getSite().getShell(), UIText.StagingView_committingNotPossible, UIText.StagingView_noStagedFiles); return; } if (!commitMessageComponent.checkCommitInfo()) return; if (!UIUtils.saveAllEditors(currentRepository, UIText.StagingView_cancelCommitAfterSaving)) return; String commitMessage = commitMessageComponent.getCommitMessage(); CommitOperation commitOperation = null; try { commitOperation = new CommitOperation(currentRepository, commitMessageComponent.getAuthor(), commitMessageComponent.getCommitter(), commitMessage); } catch (CoreException e) { Activator.handleError(UIText.StagingView_commitFailed, e, true); return; } if (amendPreviousCommitAction.isChecked()) commitOperation.setAmending(true); final boolean gerritMode = addChangeIdAction.isChecked(); commitOperation.setComputeChangeId(gerritMode); PushMode pushMode = null; if (pushUpstream) { pushMode = gerritMode ? PushMode.GERRIT : PushMode.UPSTREAM; } final Job commitJob = new CommitJob(currentRepository, commitOperation) .setOpenCommitEditor(openNewCommitsAction.isChecked()) .setPushUpstream(pushMode); enableAllWidgets(false); commitJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { asyncExec(new Runnable() { @Override public void run() { enableAllWidgets(true); IStatus result = commitJob.getResult(); if (result != null && result.isOK()) { commitMessageText.setText(EMPTY_STRING); } } }); } }); schedule(commitJob, true); CommitMessageHistory.saveCommitHistory(commitMessage); clearCommitMessageToggles(); }

Target:
private void commit(boolean pushUpstream) { if (!isCommitWithoutFilesAllowed()) { MessageDialog.openError(getSite().getShell(), UIText.StagingView_committingNotPossible, UIText.StagingView_noStagedFiles); return; } if (!commitMessageComponent.checkCommitInfo()) return; if (!UIUtils.saveAllEditors(currentRepository, UIText.StagingView_cancelCommitAfterSaving)) return; String commitMessage = commitMessageComponent.getCommitMessage(); CommitOperation commitOperation = null; try { commitOperation = new CommitOperation(currentRepository, commitMessageComponent.getAuthor(), commitMessageComponent.getCommitter(), commitMessage); } catch (CoreException e) { Activator.handleError(UIText.StagingView_commitFailed, e, true); return; } if (amendPreviousCommitAction.isChecked()) commitOperation.setAmending(true); final boolean gerritMode = addChangeIdAction.isChecked(); commitOperation.setComputeChangeId(gerritMode); PushMode pushMode = null; if (pushUpstream) { pushMode = gerritMode ? PushMode.GERRIT : PushMode.UPSTREAM; } Job commitJob = new CommitJob(currentRepository, commitOperation) .setOpenCommitEditor(openNewCommitsAction.isChecked()) .setPushUpstream(pushMode); enableAllWidgets(false); commitJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { asyncExec(new Runnable() { @Override public void run() { enableAllWidgets(true); if (event.getResult().isOK()) { commitMessageText.setText(EMPTY_STRING); } } }); } }); schedule(commitJob, true); CommitMessageHistory.saveCommitHistory(commitMessage); clearCommitMessageToggles(); }