Gush\Validator\MergeWorkflowValidator::presetGitFlow PHP Method

presetGitFlow() protected method

protected presetGitFlow ( $source, $target )
    protected function presetGitFlow($source, $target)
    {
        if ($target !== 'master') {
            return;
            // abstain decision
        }
        // Source can be master (from another org/repo)
        if ($source === 'master' || $source === 'develop' || preg_match('/^(hotfix|release)-/', $source)) {
            return true;
            // allow to merge into master
        }
        throw new MergeWorkflowException([sprintf('Workflow violation: Cannot merge "%s" into "%s".', $source, $target), 'Git-flow: Only "develop", "hotfix-" or "release-" branches are allowed to be merged into master.']);
    }