Skip to content

Commit b5f1fc5

Browse files
committed
Test for odd length commit lookups
1 parent 1074e57 commit b5f1fc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NerdBank.GitVersioning.Tests/GitContextTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void SelectCommitByFullId(bool uppercase)
6666
}
6767

6868
[Theory, CombinatorialData]
69-
public void SelectCommitByPartialId(bool fromPack)
69+
public void SelectCommitByPartialId(bool fromPack, bool oddLength)
7070
{
7171
if (fromPack)
7272
{
@@ -81,7 +81,7 @@ public void SelectCommitByPartialId(bool fromPack)
8181
this.Context = this.CreateGitContext(this.RepoPath, null);
8282
}
8383

84-
Assert.True(this.Context.TrySelectCommit(this.Context.GitCommitId.Substring(0, 12)));
84+
Assert.True(this.Context.TrySelectCommit(this.Context.GitCommitId.Substring(0, oddLength ? 11 : 13)));
8585
Assert.Equal(this.LibGit2Repository.Head.Tip.Sha, this.Context.GitCommitId);
8686
}
8787

0 commit comments

Comments
 (0)