/**
  * Returns list of version in repository.
  *
  * @return array (version => hash)
  */
 private function getVersions()
 {
     $versions = array();
     $tags = $this->repository->getTags();
     $branches = $this->repository->getBranches();
     $util = new Utils\VersionParser();
     // TODO: use dependency injection
     foreach ($tags as $tag => $hash) {
         $version = $util->parseTag($tag);
         if (!$version) {
             continue;
         }
         $versions[$version] = $tag;
     }
     foreach ($branches as $branch => $hash) {
         $version = $util->parseBranch($branch);
         $versions[$version] = $branch;
     }
     return $versions;
 }