use of org.eclipse.egit.gitflow.ui.internal.dialogs.InitDialog in project egit by eclipse.
the class InitHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell activeShell = HandlerUtil.getActiveShell(event);
final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event);
if (gfRepo == null) {
return null;
}
Repository repository = gfRepo.getRepository();
if (!gfRepo.hasBranches()) {
boolean createMaster = openQuestion(activeShell, UIText.InitHandler_emptyRepository, UIText.InitHandler_doYouWantToInitNow);
if (!createMaster) {
return null;
}
createInitialCommit(repository);
}
InitDialog dialog = new InitDialog(activeShell, gfRepo, getBranches(repository));
if (dialog.open() != Window.OK) {
return null;
}
InitOperation initOperation = new InitOperation(repository, dialog.getResult());
JobUtil.scheduleUserWorkspaceJob(initOperation, UIText.InitHandler_initializing, JobFamilies.GITFLOW_FAMILY);
return null;
}
Aggregations