Skip to content

Commit 808b929

Browse files
mirecadarturcic
authored andcommitted
Initialized IgnoreConfig is empty
1 parent 9b36db6 commit 808b929

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using GitVersion.Model.Configuration;
2+
using GitVersionCore.Tests.Helpers;
3+
using NUnit.Framework;
4+
using Shouldly;
5+
6+
namespace GitVersionCore.Tests
7+
{
8+
[TestFixture]
9+
public class IgnoreConfigTests : TestBase
10+
{
11+
[Test]
12+
public void NewInstanceShouldBeEmpty()
13+
{
14+
var ignoreConfig = new IgnoreConfig();
15+
16+
ignoreConfig.IsEmpty.ShouldBeTrue();
17+
}
18+
}
19+
}

src/GitVersionCore/Model/Configuration/IgnoreConfig.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public IgnoreConfig()
1919
[YamlMember(Alias = "sha")]
2020
public IEnumerable<string> ShAs { get; set; }
2121

22-
public virtual bool IsEmpty => Before == null && ShAs == null;
22+
public virtual bool IsEmpty => Before == null
23+
&& (ShAs == null || ShAs.Any() == false);
2324

2425
public virtual IEnumerable<IVersionFilter> ToFilters()
2526
{

0 commit comments

Comments
 (0)