protected function resolvePackedRef($ref)
{
if ($this->isFileRelative('packed-refs')) {
$packed_refs = $this->readFileRelative('packed-refs');
if (preg_match('/([0-9a-f]{40}) ' . preg_quote('refs/' . $ref, '/') . '/', $packed_refs, $matches)) {
return $matches[1];
}
}
return false;
}