fallback to parsing the packed-refs file

This commit is contained in:
Brendan Forster 2018-01-09 09:09:01 -04:00
parent 4ae8ea2d1b
commit 082c3b95e4

View file

@ -44,6 +44,11 @@ function revParse(gitDir, ref) {
// eslint-disable-next-line no-sync
fs.statSync(refPath)
} catch (err) {
const packedRefMatch = packedRefsParse(gitDir, ref)
if (packedRefMatch) {
return packedRefMatch
}
throw new Error(
`Could not de-reference HEAD to SHA, ref does not exist on disk: ${refPath}`
)