Skip to content

Commit 3ce7d15

Browse files
author
roeil
committed
chore: minor pr comments
1 parent 89b1e95 commit 3ce7d15

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/GitVersion.Core/VersionCalculation/PathFilter.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,22 @@ private bool IsMatch(string path)
3535
public bool Exclude(ICommit? commit, [NotNullWhen(true)] out string? reason)
3636
{
3737
reason = null;
38+
if (commit == null)
39+
{
40+
return false;
41+
}
3842

39-
if (commit != null)
43+
switch (mode)
4044
{
41-
switch (mode)
42-
{
43-
case PathFilterMode.Inclusive:
45+
case PathFilterMode.Inclusive:
46+
{
47+
if (commit.DiffPaths.All(this.IsMatch))
4448
{
45-
if (commit.DiffPaths.All(this.IsMatch))
46-
{
47-
reason = "Source was ignored due to all commit paths matching ignore regex";
48-
return true;
49-
}
50-
break;
49+
reason = "Source was ignored due to all commit paths matching ignore regex";
50+
return true;
5151
}
52-
}
52+
break;
53+
}
5354
}
5455

5556
return false;

src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/ConfiguredNextVersionVersionStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public IEnumerable<BaseVersion> GetBaseVersions(EffectiveBranchConfiguration con
1818
{
1919
configuration.NotNull();
2020

21-
if (!this.Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.ConfiguredNextVersion))
21+
if (!Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.ConfiguredNextVersion))
2222
yield break;
2323

2424
var nextVersion = Context.Configuration.NextVersion;

0 commit comments

Comments
 (0)