use of org.eclipse.egit.gitflow.GitFlowConfig in project egit by eclipse.
the class InitHandlerTest method testInitEmptyRepoMissingMaster.
@Test
public void testInitEmptyRepoMissingMaster() throws Exception {
String projectName = "AnyProjectName";
TestRepository testRepository = createAndShare(projectName);
selectProject(projectName);
clickInit();
bot.button("Yes").click();
fillDialog(MASTER_BRANCH_MISSING);
bot.waitUntil(shellIsActive(UIText.InitDialog_masterBranchIsMissing));
bot.button("Yes").click();
bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs"));
Repository localRepository = testRepository.getRepository();
GitFlowRepository gitFlowRepository = new GitFlowRepository(localRepository);
GitFlowConfig config = gitFlowRepository.getConfig();
assertEquals(DEVELOP_BRANCH, localRepository.getBranch());
assertEquals(MASTER_BRANCH_MISSING, config.getMaster());
assertEquals(FEATURE_BRANCH_PREFIX, config.getFeaturePrefix());
assertEquals(RELEASE_BRANCH_PREFIX, config.getReleasePrefix());
assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix());
assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix());
assertNotNull(localRepository.exactRef(Constants.R_HEADS + DEVELOP_BRANCH));
}
use of org.eclipse.egit.gitflow.GitFlowConfig in project egit by eclipse.
the class InitHandlerTest method testInit.
@Test
public void testInit() throws Exception {
selectProject(PROJ1);
clickInit();
fillDialog(MASTER_BRANCH);
bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs"));
GitFlowRepository gitFlowRepository = new GitFlowRepository(repository);
GitFlowConfig config = gitFlowRepository.getConfig();
assertEquals(DEVELOP_BRANCH, repository.getBranch());
assertEquals(MASTER_BRANCH, config.getMaster());
assertEquals(FEATURE_BRANCH_PREFIX, config.getFeaturePrefix());
assertEquals(RELEASE_BRANCH_PREFIX, config.getReleasePrefix());
assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix());
assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix());
}
use of org.eclipse.egit.gitflow.GitFlowConfig in project egit by eclipse.
the class ReleaseStartOperation method findHead.
private static String findHead(GitFlowRepository repository) {
GitFlowConfig config = repository.getConfig();
RevCommit head = repository.findHead(config.getDevelop());
if (head == null) {
throw new IllegalStateException(NLS.bind(CoreText.StartOperation_unableToFindCommitFor, config.getDevelop()));
}
return head.getName();
}
use of org.eclipse.egit.gitflow.GitFlowConfig in project egit by eclipse.
the class FeatureStartOperation method execute.
@Override
public void execute(IProgressMonitor monitor) throws CoreException {
GitFlowConfig config = repository.getConfig();
String branchName = config.getFeatureBranchName(featureName);
RevCommit head = repository.findHead(config.getDevelop());
if (head == null) {
throw new IllegalStateException(NLS.bind(CoreText.StartOperation_unableToFindCommitFor, config.getDevelop()));
}
start(monitor, branchName, head);
}
use of org.eclipse.egit.gitflow.GitFlowConfig in project egit by eclipse.
the class InitHandlerTest method testInitMissingMaster.
@Test
public void testInitMissingMaster() throws Exception {
selectProject(PROJ1);
clickInit();
fillDialog(MASTER_BRANCH_MISSING);
bot.waitUntil(shellIsActive(UIText.InitDialog_masterBranchIsMissing));
bot.button("Yes").click();
bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs"));
GitFlowRepository gitFlowRepository = new GitFlowRepository(repository);
GitFlowConfig config = gitFlowRepository.getConfig();
assertEquals(DEVELOP_BRANCH, repository.getBranch());
assertEquals(MASTER_BRANCH_MISSING, config.getMaster());
assertEquals(FEATURE_BRANCH_PREFIX, config.getFeaturePrefix());
assertEquals(RELEASE_BRANCH_PREFIX, config.getReleasePrefix());
assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix());
assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix());
assertNotNull(repository.exactRef(Constants.R_HEADS + DEVELOP_BRANCH));
}
Aggregations