/** * Parses the refs from IO into tags and branches */ private function parseRefs() { $refs = $this->io->readRefs(); foreach ($refs as $file) { if (substr($file, 0, 5) == 'tags/') { $name = substr($file, 5); $this->tags[$name] = $this->getTag($name); } elseif (substr($file, 0, 6) == 'heads/') { $name = substr($file, 6); $this->branches[$name] = $this->getBranch($name); } } }