Skip to content

Commit e95b565

Browse files
committed
Fixed some broken tests
1 parent 9c35a70 commit e95b565

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
@@ -14,9 +14,13 @@ public static Config ApplyDefaults(this Config config)
1414
return config;
1515
}
1616

17-
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true)
17+
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration = null, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true)
1818
{
19-
ConfigurationProvider.ApplyDefaultsTo(configuration);
19+
if (configuration == null)
20+
{
21+
configuration = new Config();
22+
ConfigurationProvider.ApplyDefaultsTo(configuration);
23+
}
2024
var gitVersionContext = new GitVersionContext(repository ?? fixture.Repository, configuration, isForTrackedBranchOnly, commitId);
2125
var executeGitVersion = ExecuteGitVersion(gitVersionContext);
2226
var variables = VariableProvider.GetVariablesFor(executeGitVersion, gitVersionContext.Configuration, gitVersionContext.IsCurrentCommitTagged);
@@ -54,7 +58,7 @@ public static void AssertFullSemver(this RepositoryFixtureBase fixture, Config c
5458
}
5559
if (commitId == null)
5660
{
57-
fixture.SequenceDiagram.NoteOver(fullSemver, fixture.Repository.Head.FriendlyName, color: "#D3D3D3");
61+
fixture.SequenceDiagram.NoteOver(fullSemver, fixture.Repository.Head.FriendlyName, color: "#D3D3D3");
5862
}
5963
}
6064

src/GitVersionCore.Tests/IntegrationTests/DocumentationSamples.cs

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

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

400400
// 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)