Skip to content

Commit

Permalink
Fix resolving HEAD reference if it's a packed ref
Browse files Browse the repository at this point in the history
  • Loading branch information
filipnavara authored and AArnott committed Jun 12, 2021
1 parent e9b28de commit 47d7f46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/NerdBank.GitVersioning/ManagedGit/GitRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ private GitObjectId ResolveReference(object reference)
{
if (!FileHelpers.TryOpen(Path.Combine(this.CommonDirectory, (string)reference), out FileStream? stream))
{
return GitObjectId.Empty;
// HEAD can point to a reference that's in the packed references and needs
// a full resolution.
return Lookup((string)reference) ?? GitObjectId.Empty;
}

using (stream)
Expand Down

0 comments on commit 47d7f46

Please sign in to comment.