protected function doAddBranches($resource, array $branchBlacklist)
    {
        do {
            $branchData = JsonFile::parseJson((string) $this->getContents($resource), $resource);

            foreach ($branchData as $branch) {
                $name = substr($branch['ref'], 11);

                if (!\in_array($name, $branchBlacklist, true)) {
                    $this->branches[$name] = $branch['object']['sha'];
                }
            }

            $resource = $this->getNextPage();
        } while ($resource);
    }