Skip to content

Commit 6c6695d

Browse files
gitfoolarturcic
authored andcommitted
Check early for commit on current branch
1 parent be48ce3 commit 6c6695d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/GitVersionCore/VersionCalculation/BaseVersionCalculators/FallbackVersionStrategy.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ public override IEnumerable<BaseVersion> GetVersions()
2222
{
2323
Commit baseVersionSource;
2424
var currentBranchTip = Context.CurrentBranch.Tip;
25+
if (currentBranchTip == null)
26+
{
27+
throw new GitVersionException("No commits found on the current branch.");
28+
}
2529

2630
try
2731
{

0 commit comments

Comments
 (0)