Skip to content

Commit 4d95d36

Browse files
committed
Merge remote-tracking branch 'jazzdelightsme/personal/danthom/WhatIfNoRepo_103' into fix103
2 parents e7b28df + 913250a commit 4d95d36

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/NerdBank.GitVersioning/VersionOracle.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ private static LibGit2Sharp.Repository OpenGitRepo(string repoRoot)
278278

279279
private static Version GetAssemblyVersion(Version version, VersionOptions versionOptions)
280280
{
281+
// If there is no repo, "version" could have uninitialized components (-1).
282+
version = version.EnsureNonNegativeComponents();
283+
281284
var assemblyVersion = versionOptions?.AssemblyVersion?.Version ?? new System.Version(version.Major, version.Minor);
282285
assemblyVersion = new System.Version(
283286
assemblyVersion.Major,

0 commit comments

Comments
 (0)