Get the SHA from the unresolved target otherwise we'll crash later.
Better solution to getting the appropriate branch SHA.
Back to id.
Merge pull request #222 from libgit2/fix-reference-named-crash

Get the SHA from the unresolvedTarget otherwise we'll crash later.