Skip to content

Commit 22741e9

Browse files
committed
Fixed some broken tests
1 parent 735c62e commit 22741e9

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/GitVersionCore.Tests/GitToolsTestingExtensions.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ public static Config ApplyDefaults(this Config config)
1515
return config;
1616
}
1717

18-
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true)
18+
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration = null, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true)
1919
{
20-
ConfigurationProvider.ApplyDefaultsTo(configuration);
20+
if (configuration == null)
21+
{
22+
configuration = new Config();
23+
ConfigurationProvider.ApplyDefaultsTo(configuration);
24+
}
2125
var gitVersionContext = new GitVersionContext(repository ?? fixture.Repository, configuration, isForTrackedBranchOnly, commitId);
2226
var executeGitVersion = ExecuteGitVersion(gitVersionContext);
2327
var variables = VariableProvider.GetVariablesFor(executeGitVersion, gitVersionContext.Configuration, gitVersionContext.IsCurrentCommitTagged);
@@ -55,7 +59,7 @@ public static void AssertFullSemver(this RepositoryFixtureBase fixture, Config c
5559
}
5660
if (commitId == null)
5761
{
58-
fixture.SequenceDiagram.NoteOver(fullSemver, fixture.Repository.Head.FriendlyName, color: "#D3D3D3");
62+
fixture.SequenceDiagram.NoteOver(fullSemver, fixture.Repository.Head.FriendlyName, color: "#D3D3D3");
5963
}
6064
}
6165

src/GitVersionCore.Tests/IntegrationTests/DocumentationSamples.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public void GitHubFlowMajorRelease()
395395
fixture.AssertFullSemver("2.0.0-beta.1");
396396

397397
// test that the CommitsSinceVersionSource should still return commit count
398-
var version = fixture.GetVersion(new Config());
398+
var version = fixture.GetVersion();
399399
version.CommitsSinceVersionSource.ShouldBe("2");
400400

401401
// Make a commit after a tag should bump up the beta

src/GitVersionCore/Configuration/BranchConfig.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public BranchConfig(BranchConfig branchConfiguration)
1717
TagNumberPattern = branchConfiguration.TagNumberPattern;
1818
TrackMergeTarget = branchConfiguration.TrackMergeTarget;
1919
CommitMessageIncrementing = branchConfiguration.CommitMessageIncrementing;
20+
IsDevelop = branchConfiguration.IsDevelop;
21+
IsReleaseBranch = branchConfiguration.IsReleaseBranch;
2022
}
2123

2224
[YamlMember(Alias = "mode")]

0 commit comments

Comments
 (0)