use of org.eclipse.egit.ui.internal.commands.shared.AbstractRebaseCommandHandler in project egit by eclipse.
the class AbstractRebaseHistoryCommandHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RevCommit revCommit = AdapterUtils.adapt(getSelection(event).getFirstElement(), RevCommit.class);
if (!(revCommit instanceof PlotCommit)) {
return null;
}
PlotCommit commit = (PlotCommit) revCommit;
final Repository repository = getRepository(event);
if (repository == null)
return null;
String currentBranch = getCurrentBranch(repository);
final Ref ref = getRef(commit, repository, currentBranch);
String jobname = NLS.bind(UIText.RebaseCurrentRefCommand_RebasingCurrentJobName, currentBranch, ref.getName());
AbstractRebaseCommandHandler rebaseCurrentRef = new AbstractRebaseCommandHandler(jobname, UIText.RebaseCurrentRefCommand_RebaseCanceledMessage) {
@Override
protected RebaseOperation createRebaseOperation(Repository repository2) throws ExecutionException {
return AbstractRebaseHistoryCommandHandler.this.createRebaseOperation(repository2, ref);
}
};
rebaseCurrentRef.execute(repository);
return null;
}
Aggregations