/******************************************************************************* * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ package org.eclipse.egit.gitflow.op; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.egit.gitflow.GitFlowConfig; import org.eclipse.egit.gitflow.GitFlowRepository; import org.eclipse.egit.gitflow.internal.CoreText; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.osgi.util.NLS; /** * git flow feature start */ public final class FeatureStartOperation extends AbstractFeatureOperation { /** * @param repository * @param featureName */ public FeatureStartOperation(GitFlowRepository repository, String featureName) { super(repository, featureName); } @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); } @Override public ISchedulingRule getSchedulingRule() { return null; } }