public function branches(string $user, string $repo): array
    {
        $default = [];
        $api = $this->client->api('git_data')->references();
        $params = [$api, 'branches', [$user, $repo]];

        $refs = $this->callGitHub([$this->pager, 'fetchAll'], $params, $default);

        array_walk($refs, function (&$data) {
            $data['name'] = str_replace('refs/heads/', '', $data['ref']);
        });

        usort($refs, $this->branchSorter());

        return $refs;
    }