protected function getRepositoryBranch()
    {
        // If we passed a branch, use it
        if ($branch = $this->getOption('branch')) {
            return $branch;
        }

        // Get branch from config, else compute the fallback
        $branch = $this->config->getContextually('vcs.branch');
        if (!$branch) {
            $fallback = $this->bash->on('local', function () {
                return $this->vcs->runSilently('currentBranch');
            });

            $fallback = $fallback ?: 'master';
            $branch = trim($fallback);
        }

        return $branch;
    }