if (message.length() == 0)
message = null;
boolean includeUntracked = commitMessageDialog.getIncludeUntracked();
final StashCreateOperation op = new StashCreateOperation(repo, message,
includeUntracked);
Job job = new WorkspaceJob(UIText.StashCreateCommand_jobTitle) {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) {
monitor.beginTask("", 1); //$NON-NLS-1$
try {
op.execute(monitor);
RevCommit commit = op.getCommit();
if (commit == null)
showNoChangesToStash();
} catch (CoreException e) {
Activator
.logError(UIText.StashCreateCommand_stashFailed, e);
}
return Status.OK_STATUS;
}
@Override
public boolean belongsTo(Object family) {
if (JobFamilies.STASH.equals(family))
return true;
return super.belongsTo(family);
}
};
job.setUser(true);
job.setRule(op.getSchedulingRule());
job.schedule();
return true;
}