protected function aggregateBranchDetails($groupLines, $remoteDetails)
    {
        $configuredRefs = [];
        arsort($groupLines);
        foreach ($groupLines as $type => $lineno) {
            $configuredRefs[$type] = array_splice($remoteDetails, $lineno);
            array_shift($configuredRefs[$type]);
        }

        $configuredRefs['remoteBranches'] = isset($configuredRefs['remoteBranches'])
            ? $this->parseRemoteBranches($configuredRefs['remoteBranches'])
            : [];

        $configuredRefs['localBranches'] = isset($configuredRefs['localBranches'])
            ? $this->parseLocalPullBranches($configuredRefs['localBranches'])
            : [];

        $configuredRefs['localRefs'] = isset($configuredRefs['localRefs'])
            ? $this->parseLocalPushRefs($configuredRefs['localRefs'])
            : [];

        $aggBranches = [];
        foreach ($configuredRefs as $branches) {
            foreach ($branches as $branchName => $data) {
                if (!isset($aggBranches[$branchName])) {
                    $aggBranches[$branchName] = [];
                }
                $aggBranches[$branchName] = $aggBranches[$branchName] + $data;
            }
        }

        return $aggBranches;
    }