Skip to content

Commit e6696dc

Browse files
committed
The peeled target isn't necessarily a Commit; it can be a Blob of any kind. Safe-cast it to Commit and only use it if it's not null. Should fix #721.
1 parent 3d421be commit e6696dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/GitVersionCore/VersionCalculation/BaseVersionCalculators/HighestTagBaseVersionStrategy.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
3030
SemanticVersion version;
3131
if (SemanticVersion.TryParse(t.Name, context.Configuration.GitTagPrefix, out version))
3232
{
33-
return new VersionTaggedCommit((Commit)t.PeeledTarget(), version, t.Name);
33+
var commit = t.PeeledTarget() as Commit;
34+
if (commit != null)
35+
return new VersionTaggedCommit(commit, version, t.Name);
3436
}
3537
return null;
3638
})

0 commit comments

Comments
 (0)