if ($repository->hasCommit($hash)) {
$commitish = $hash;
}
}
if ($commitish === null) {
// DEBUG Can you have a repo with no branches? How should we handle
// that?
$branches = $repository->getBranches();
$tags = $repository->getTags();
if ($tags !== null && count($tags) > 0) {
$branches = array_merge($branches, $tags);
}