Skip to content

Commit

Permalink
Add repro test for #602
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Jun 12, 2021
1 parent daa0303 commit e9b28de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/NerdBank.GitVersioning.Tests/GitContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,15 @@ public void SelectDirectory_SubDir()
Assert.Equal("sub", this.Context.RepoRelativeProjectDirectory);
Assert.Equal(absolutePath, this.Context.AbsoluteProjectDirectory);
}
}

[Fact]
public void GetVersion_PackedHead()
{
using var expandedRepo = TestUtilities.ExtractRepoArchive("PackedHeadRef");
this.Context = this.CreateGitContext(Path.Combine(expandedRepo.RepoPath));
var oracle = new VersionOracle(this.Context);
Assert.Equal("1.0.1", oracle.SimpleVersion.ToString());
this.Context.TrySelectCommit("HEAD");
Assert.Equal("1.0.1", oracle.SimpleVersion.ToString());
}
}
Binary file not shown.

0 comments on commit e9b28de

Please sign in to comment.