use of org.eclipse.egit.gitflow.op.HotfixStartOperation in project egit by eclipse.
the class GitFlowRepositoryTest method testGetHotfixBranches.
@Test
public void testGetHotfixBranches() throws Exception {
repository1.createInitialCommit("testGetHotfixBranches\n\nfirst commit\n");
Repository repository = repository1.getRepository();
GitFlowRepository gfRepo = new GitFlowRepository(repository);
new InitOperation(repository).execute(null);
assertTrue(gfRepo.getHotfixBranches().isEmpty());
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
new ReleaseFinishOperation(gfRepo, MY_RELEASE).execute(null);
new HotfixStartOperation(gfRepo, MY_HOTFIX).execute(null);
assertEquals(R_HEADS + gfRepo.getConfig().getHotfixPrefix() + MY_HOTFIX, gfRepo.getHotfixBranches().get(0).getName());
}
use of org.eclipse.egit.gitflow.op.HotfixStartOperation in project egit by eclipse.
the class HotfixStartHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event);
InputDialog inputDialog = new InputDialog(HandlerUtil.getActiveShell(event), UIText.HotfixStartHandler_provideHotfixName, UIText.HotfixStartHandler_pleaseProvideANameForTheNewHotfix, // $NON-NLS-1$
"", new HotfixNameValidator(gfRepo));
if (inputDialog.open() != Window.OK) {
return null;
}
final String hotfixName = inputDialog.getValue();
HotfixStartOperation hotfixStartOperation = new HotfixStartOperation(gfRepo, hotfixName);
JobUtil.scheduleUserWorkspaceJob(hotfixStartOperation, UIText.HotfixStartHandler_startingNewHotfix, JobFamilies.GITFLOW_FAMILY);
return null;
}
Aggregations