diff --git a/src/GitVersion.App.Tests/ArgumentParserTests.cs b/src/GitVersion.App.Tests/ArgumentParserTests.cs index 9dd75e0c7e..181578019e 100644 --- a/src/GitVersion.App.Tests/ArgumentParserTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserTests.cs @@ -597,8 +597,8 @@ public void EnsureAssemblyInfoFalse() [Test] public void DynamicRepoLocation() { - var arguments = this.argumentParser.ParseArguments("-dynamicRepoLocation c:\\foo\\"); - arguments.ClonePath.ShouldBe("c:\\foo\\"); + var arguments = this.argumentParser.ParseArguments(@"-dynamicRepoLocation /tmp/foo"); + arguments.ClonePath.ShouldBe("/tmp/foo"); } [Test] @@ -748,14 +748,14 @@ public void EnsureFormatIsSet() } [TestCase("custom-config.yaml")] - [TestCase(@"c:\custom-config.yaml")] + [TestCase("/tmp/custom-config.yaml")] public void ThrowIfConfigurationFileDoesNotExist(string configFile) => Should.Throw(() => _ = this.argumentParser.ParseArguments($"-config {configFile}")); [Test] public void EnsureConfigurationFileIsSet() { - var configFile = Path.GetTempPath() + Guid.NewGuid() + ".yaml"; + var configFile = PathHelper.GetTempPath() + Guid.NewGuid() + ".yaml"; File.WriteAllText(configFile, "next-version: 1.0.0"); var arguments = this.argumentParser.ParseArguments($"-config {configFile}"); arguments.ConfigurationFile.ShouldBe(configFile); diff --git a/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs b/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs index b93966f73c..38a3cc95d6 100644 --- a/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs +++ b/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs @@ -142,9 +142,9 @@ public async Task VerifyBitBucketPipelinesPullRequest(string pullRequestRef) private static async Task VerifyPullRequestVersionIsCalculatedProperly(string pullRequestRef, Dictionary env) { - using var fixture = new EmptyRepositoryFixture("main"); - var remoteRepositoryPath = PathHelper.GetTempPath(); - RepositoryFixtureBase.Init(remoteRepositoryPath, "main"); + using var fixture = new EmptyRepositoryFixture(); + var remoteRepositoryPath = PathHelper.GetRepositoryTempPath(); + RepositoryFixtureBase.Init(remoteRepositoryPath); using (var remoteRepository = new Repository(remoteRepositoryPath)) { remoteRepository.Config.Set("user.name", "Test"); diff --git a/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs b/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs index cb0e33f4f6..b66e9debf6 100644 --- a/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs +++ b/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs @@ -34,9 +34,9 @@ public async Task VerifyTagCheckoutOnGitHubActions() private static async Task VerifyTagCheckoutVersionIsCalculatedProperly(Dictionary env) { - using var fixture = new EmptyRepositoryFixture("main"); - var remoteRepositoryPath = PathHelper.GetTempPath(); - RepositoryFixtureBase.Init(remoteRepositoryPath, "main"); + using var fixture = new EmptyRepositoryFixture(); + var remoteRepositoryPath = PathHelper.GetRepositoryTempPath(); + RepositoryFixtureBase.Init(remoteRepositoryPath); using (var remoteRepository = new Repository(remoteRepositoryPath)) { remoteRepository.Config.Set("user.name", "Test"); diff --git a/src/GitVersion.App/ArgumentParser.cs b/src/GitVersion.App/ArgumentParser.cs index 781d431574..2f9e53197c 100644 --- a/src/GitVersion.App/ArgumentParser.cs +++ b/src/GitVersion.App/ArgumentParser.cs @@ -174,7 +174,7 @@ private void ParseTargetPath(Arguments arguments, string? name, IReadOnlyList(); // set environment variable and create an empty envrun file to indicate that EnvRun is running... - this.mFilePath = PathHelper.Combine(Path.GetTempPath(), "envrun.db"); + this.mFilePath = PathHelper.Combine(PathHelper.GetTempPath(), "envrun.db"); this.environment.SetEnvironmentVariable(EnvVarName, this.mFilePath); File.OpenWrite(this.mFilePath).Dispose(); } diff --git a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs index 22aa017ec9..ba988d2fba 100644 --- a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs +++ b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs @@ -13,9 +13,6 @@ public static class ConfigurationFileLocatorTests { public class DefaultConfigFileLocatorTests : TestBase { - private const string DefaultRepoPath = @"c:\MyGitRepo"; - private const string DefaultWorkingPath = @"c:\MyGitRepo\Working"; - private string repoPath; private string workingPath; private IFileSystem fileSystem; @@ -25,8 +22,8 @@ public class DefaultConfigFileLocatorTests : TestBase [SetUp] public void Setup() { - this.repoPath = DefaultRepoPath; - this.workingPath = DefaultWorkingPath; + this.repoPath = Path.Combine(PathHelper.GetTempPath(), "MyGitRepo"); + this.workingPath = Path.Combine(PathHelper.GetTempPath(), "MyGitRepo", "Working"); var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath }); var sp = ConfigureServices(services => services.AddSingleton(options)); @@ -76,8 +73,8 @@ private string SetupConfigFileContent(string text, string fileName, string path) public class NamedConfigurationFileLocatorTests : TestBase { - private const string DefaultRepoPath = @"c:\MyGitRepo"; - private const string DefaultWorkingPath = @"c:\MyGitRepo\Working"; + private static readonly string DefaultRepoPath = Path.Combine(PathHelper.GetTempPath(), "MyGitRepo"); + private static readonly string DefaultWorkingPath = Path.Combine(PathHelper.GetTempPath(), "MyGitRepo", "Working"); private const string myConfigYaml = "my-config.yaml"; private string repoPath; @@ -189,7 +186,7 @@ public void NoWarnOnCustomYmlFileOutsideRepoPath() this.configFileLocator = sp.GetRequiredService(); this.fileSystem = sp.GetRequiredService(); - SetupConfigFileContent(string.Empty, path: @"c:\\Unrelated\\path"); + SetupConfigFileContent(string.Empty, path: PathHelper.Combine(PathHelper.GetTempPath(), "unrelatedPath")); var configurationProvider = (ConfigurationProvider)sp.GetRequiredService(); diff --git a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs index de631d05bf..4564e74cbe 100644 --- a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs +++ b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs @@ -13,8 +13,6 @@ namespace GitVersion.Core.Tests; [TestFixture] public class ConfigurationProviderTests : TestBase { - private const string DefaultRepoPath = @"c:\MyGitRepo"; - private string repoPath; private ConfigurationProvider configurationProvider; private IFileSystem fileSystem; @@ -22,7 +20,7 @@ public class ConfigurationProviderTests : TestBase [SetUp] public void Setup() { - this.repoPath = DefaultRepoPath; + this.repoPath = Path.Combine(PathHelper.GetTempPath(), "MyGitRepo"); var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath }); var sp = ConfigureServices(services => services.AddSingleton(options)); this.configurationProvider = (ConfigurationProvider)sp.GetRequiredService(); diff --git a/src/GitVersion.Configuration/ConfigurationFileLocator.cs b/src/GitVersion.Configuration/ConfigurationFileLocator.cs index eda43e01a0..a3e763e38b 100644 --- a/src/GitVersion.Configuration/ConfigurationFileLocator.cs +++ b/src/GitVersion.Configuration/ConfigurationFileLocator.cs @@ -19,7 +19,7 @@ public bool TryGetConfigurationFile(string? workingDirectory, string? projectRoo public void Verify(string? workingDirectory, string? projectRootDirectory) { - if (!Path.IsPathRooted(this.configurationFile) && !fileSystem.PathsEqual(workingDirectory, projectRootDirectory)) + if (!Path.IsPathRooted(this.configurationFile) && !PathHelper.Equal(workingDirectory, projectRootDirectory)) WarnAboutAmbiguousConfigFileSelection(workingDirectory, projectRootDirectory); } diff --git a/src/GitVersion.Configuration/ConfigurationProvider.cs b/src/GitVersion.Configuration/ConfigurationProvider.cs index aa4920a6b9..6481e72304 100644 --- a/src/GitVersion.Configuration/ConfigurationProvider.cs +++ b/src/GitVersion.Configuration/ConfigurationProvider.cs @@ -1,20 +1,15 @@ using GitVersion.Configuration.SupportedWorkflows; using GitVersion.Extensions; -using GitVersion.Logging; using Microsoft.Extensions.Options; using YamlDotNet.Core; namespace GitVersion.Configuration; internal class ConfigurationProvider( - IFileSystem fileSystem, - ILog log, IConfigurationFileLocator configFileLocator, IOptions options) : IConfigurationProvider { - private readonly IFileSystem fileSystem = fileSystem.NotNull(); - private readonly ILog log = log.NotNull(); private readonly IConfigurationFileLocator configFileLocator = configFileLocator.NotNull(); private readonly IOptions options = options.NotNull(); diff --git a/src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs index 34d252ad8f..35e976bcb6 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs @@ -15,7 +15,7 @@ public class GitVersionTaskDirectoryTests : TestBase [SetUp] public void SetUp() { - this.workDirectory = PathHelper.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); + this.workDirectory = PathHelper.Combine(PathHelper.GetTempPath(), Guid.NewGuid().ToString()); this.gitDirectory = Repository.Init(this.workDirectory).TrimEnd(Path.DirectorySeparatorChar); Assert.That(this.gitDirectory, Is.Not.Null); } diff --git a/src/GitVersion.Core.Tests/Helpers/GitVersionContextBuilder.cs b/src/GitVersion.Core.Tests/Helpers/GitVersionContextBuilder.cs index 51be354189..abce552ffd 100644 --- a/src/GitVersion.Core.Tests/Helpers/GitVersionContextBuilder.cs +++ b/src/GitVersion.Core.Tests/Helpers/GitVersionContextBuilder.cs @@ -5,12 +5,13 @@ namespace GitVersion.Core.Tests; -public class GitVersionContextBuilder +public class GitVersionContextBuilder : IDisposable { private IGitRepository? repository; + private EmptyRepositoryFixture? emptyRepositoryFixture; private IReadOnlyDictionary? overrideConfiguration; - public IServiceProvider? ServicesProvider; private Action? overrideServices; + public IServiceProvider? ServicesProvider; public GitVersionContextBuilder WithRepository(IGitRepository gitRepository) { @@ -56,11 +57,8 @@ public void Build() { var repo = this.repository ?? CreateRepository(); - var options = Options.Create(new GitVersionOptions - { - WorkingDirectory = new EmptyRepositoryFixture().RepositoryPath, - ConfigurationInfo = { OverrideConfiguration = this.overrideConfiguration } - }); + emptyRepositoryFixture = new(); + var options = Options.Create(new GitVersionOptions { WorkingDirectory = emptyRepositoryFixture.RepositoryPath, ConfigurationInfo = { OverrideConfiguration = this.overrideConfiguration } }); this.ServicesProvider = ConfigureServices(services => { @@ -94,4 +92,21 @@ private static IServiceProvider ConfigureServices(Action? ov return services.BuildServiceProvider(); } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (!disposing) + { + return; + } + + this.repository?.Dispose(); + this.emptyRepositoryFixture?.Dispose(); + } } diff --git a/src/GitVersion.Core.Tests/Helpers/TestConsoleAdapter.cs b/src/GitVersion.Core.Tests/Helpers/TestConsoleAdapter.cs index 7dde989624..cf136b9934 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestConsoleAdapter.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestConsoleAdapter.cs @@ -1,3 +1,4 @@ +using GitVersion.Helpers; using GitVersion.Logging; namespace GitVersion.Core.Tests.Helpers; diff --git a/src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs b/src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs index 1e6464ef70..432d1e16dd 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs @@ -4,7 +4,7 @@ namespace GitVersion.Core.Tests.Helpers; public class TestFileSystem : IFileSystem { - private readonly Dictionary fileSystem = new(StringComparerUtils.OsDependentComparer); + private readonly Dictionary fileSystem = new(SysEnv.OSVersion.Platform == PlatformID.Unix ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase); public void Copy(string from, string to, bool overwrite) { @@ -94,9 +94,4 @@ public bool DirectoryExists(string path) } public long GetLastDirectoryWrite(string path) => 1; - - public bool PathsEqual(string? path, string? otherPath) => string.Equals( - Path.GetFullPath(path ?? throw new ArgumentNullException(nameof(path))).TrimEnd('\\').TrimEnd('/'), - Path.GetFullPath(otherPath ?? throw new ArgumentNullException(nameof(otherPath))).TrimEnd('\\').TrimEnd('/'), - StringComparerUtils.OsDependentComparison); } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/ComparingTheBehaviorOfDifferentVersioningModes.cs b/src/GitVersion.Core.Tests/IntegrationTests/ComparingTheBehaviorOfDifferentVersioningModes.cs index fb234bb458..13a25d7a30 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/ComparingTheBehaviorOfDifferentVersioningModes.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/ComparingTheBehaviorOfDifferentVersioningModes.cs @@ -46,7 +46,7 @@ private static GitHubFlowConfigurationBuilder GetConfigurationBuilder() => GitHu [Test] public void ExpectedBehavior() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); @@ -172,7 +172,7 @@ public void ExpectedBehavior() [Test] public void MainRelease() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("0.0.2"); @@ -186,7 +186,7 @@ public void MainRelease() [Test] public void MergeFeatureToMain() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("0.0.2"); fixture.BranchTo("feature/test"); @@ -220,7 +220,7 @@ public void MergeFeatureToMain() [Test] public void MergeFeatureToMainWithPreviousCommits() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("0.0.2"); fixture.MakeACommit(); @@ -270,7 +270,7 @@ public void MergeFeatureToMainWithPreviousCommits() [Test] public void MergeFeatureToMainWithMinorMinorSemversionIncrement() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("0.0.2"); fixture.BranchTo("feature/test"); @@ -304,7 +304,7 @@ public void MergeFeatureToMainWithMinorMinorSemversionIncrement() [Test] public void MergeFeatureToMainWithMajorMinorSemversionIncrement() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("0.0.2"); fixture.BranchTo("feature/test"); @@ -338,7 +338,7 @@ public void MergeFeatureToMainWithMajorMinorSemversionIncrement() [Test] public void MergeFeatureToMainWithPreviousCommitsAndMinorMinorSemversionIncrement() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("0.0.2"); fixture.MakeACommit("+semver: minor"); @@ -388,7 +388,7 @@ public void MergeFeatureToMainWithPreviousCommitsAndMinorMinorSemversionIncremen [Test] public void MergeFeatureToMainWithPreviousCommitsAndMinorMajorSemversionIncrement() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("0.0.2"); fixture.MakeACommit("+semver: minor"); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/CreatingAFeatureBranchFromAReleaseBranchScenario.cs b/src/GitVersion.Core.Tests/IntegrationTests/CreatingAFeatureBranchFromAReleaseBranchScenario.cs index 8f30cec592..50d2c3e7f1 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/CreatingAFeatureBranchFromAReleaseBranchScenario.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/CreatingAFeatureBranchFromAReleaseBranchScenario.cs @@ -22,7 +22,7 @@ public void ShouldTreatTheFeatureBranchLikeTheFirstReleaseBranchWhenItHasBeenBra var configuration = GitFlowConfigurationBuilder.New.Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit(); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs index 186e233f74..9f56c41b7d 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs @@ -39,7 +39,7 @@ public void ShouldNotFallbackToBaseVersionWhenAllCommitsAreNotIgnored(string? ne [Test] public void GivenTrunkBasedWorkflowWithCommitParameterThenVersionShouldBeCorrect() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); var commitB = fixture.Repository.MakeACommit("B"); @@ -55,7 +55,7 @@ public void GivenTrunkBasedWorkflowWithCommitParameterThenVersionShouldBeCorrect [Test] public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitThenVersionShouldBeCorrect() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); var commitB = fixture.Repository.MakeACommit("B"); @@ -73,7 +73,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitThenVersionSh [Test] public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitBAndCommitParameterAThenVersionShouldBeCorrect() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); var commitB = fixture.Repository.MakeACommit("B"); @@ -91,7 +91,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitBAndCommitPar [Test] public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitCAndCommitParameterCThenCommitBShouldBeUsed() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); @@ -108,7 +108,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitCAndCommitPar [Test] public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForTaggedCommitThenTagShouldBeIgnored() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); @@ -127,7 +127,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForTaggedCommitThenTag [Test] public void GivenTrunkBasedWorkflowWithIgnoreConfigurationBeforeCommitWithTagThenTagShouldBeIgnored() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); @@ -148,7 +148,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationBeforeCommitWithTagThe public void GivenTrunkBasedWorkflowWithIgnoreConfigurationOfCommitBThenTagShouldBeConsidered( bool preventIncrementWhenCurrentCommitTagged, string semanticVersion) { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("1.0.0"); @@ -170,7 +170,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationOfCommitBThenTagShould public void GivenTrunkBasedWorkflowWithCommitParameterBThenTagShouldBeConsidered( bool preventIncrementWhenCurrentCommitTagged, string semanticVersion) { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); var commitA = fixture.Repository.MakeACommit("A"); fixture.ApplyTag("1.0.0"); @@ -189,7 +189,7 @@ public void GivenTrunkBasedWorkflowWithCommitParameterBThenTagShouldBeConsidered [Test] public void GivenGitHubFlowBasedWorkflowWithCommitParameterThenVersionShouldBeCorrect() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); var commitB = fixture.Repository.MakeACommit("B"); @@ -205,7 +205,7 @@ public void GivenGitHubFlowBasedWorkflowWithCommitParameterThenVersionShouldBeCo [Test] public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitThenVersionShouldBeCorrect() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); var commitB = fixture.Repository.MakeACommit("B"); @@ -223,7 +223,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitThenVersionSh [Test] public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitBAndCommitParameterAThenVersionShouldBeCorrect() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); var commitB = fixture.Repository.MakeACommit("B"); @@ -241,7 +241,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitBAndCommitPar [Test] public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitCAndCommitParameterCThenCommitBShouldBeUsed() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); @@ -258,7 +258,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitCAndCommitPar [Test] public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForTaggedCommitThenTagShouldBeIgnored() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); @@ -277,7 +277,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForTaggedCommitThenTag [Test] public void GivenGitHubFlowWorkflowWithIgnoreConfigurationBeforeCommitWithTagThenTagShouldBeIgnored() { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); @@ -298,7 +298,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationBeforeCommitWithTagThe public void GivenGitHubFlowWorkflowWithIgnoreConfigurationOfCommitBThenTagShouldBeConsidered( bool preventIncrementWhenCurrentCommitTagged, string semanticVersion) { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("1.0.0"); @@ -318,7 +318,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationOfCommitBThenTagShould public void GivenGitHubFlowWorkflowWithCommitParameterBThenTagShouldBeConsidered( bool preventIncrementWhenCurrentCommitTagged, string semanticVersion) { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); var commitA = fixture.Repository.MakeACommit("A"); fixture.ApplyTag("1.0.0"); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/OtherScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/OtherScenarios.cs index 6ccb0c86b2..2b387ec7bc 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/OtherScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/OtherScenarios.cs @@ -200,7 +200,7 @@ public void EnsurePreReleaseTagLabelWillBeConsideredIfNoLabelIsDefined(long patc .WithLabel(null).WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -265,7 +265,7 @@ public void EnsurePreReleaseTagLabelWithInitialTagForPatchNumberOneWillBeConside .WithLabel(null).WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); fixture.MakeACommit(); @@ -332,7 +332,7 @@ public void EnsurePreReleaseTagLabelWithInitialTagForPatchNumberTwoAndThreeWillB .WithLabel(null).WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); fixture.MakeACommit(); @@ -399,7 +399,7 @@ public void EnsurePreReleaseTagLabelWillBeConsideredIfLabelIsEmpty(long patchNum .WithLabel(string.Empty).WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -463,7 +463,7 @@ public void EnsurePreReleaseTagLabelWithInitialTagWillBeConsideredIfLabelIsEmpty .WithLabel(string.Empty).WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); fixture.MakeACommit(); @@ -529,7 +529,7 @@ public void EnsurePreReleaseTagLabelWillBeConsideredIfAlphaLabelIsDefined(long p .WithLabel("alpha").WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -596,7 +596,7 @@ public void EnsurePreReleaseTagLabelWithInitialTagWillBeConsideredIfAlphaLabelIs .WithLabel("alpha").WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); fixture.MakeACommit(); @@ -663,7 +663,7 @@ public void EnsurePreReleaseTagLabelWillBeConsideredIfBetaLabelIsDefined(long pa .WithLabel("beta").WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -727,7 +727,7 @@ public void EnsurePreReleaseTagLabelWithInitialTagWillBeConsideredIfBetaLabelIsD .WithLabel("beta").WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); fixture.MakeACommit(); @@ -792,7 +792,7 @@ public void EnsurePreReleaseTagLabelWillBeConsideredIfGammaLabelIsDefined(long p .WithLabel("gamma").WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -856,7 +856,7 @@ public void EnsurePreReleaseTagLabelWithInitialTagWillBeConsideredIfGammaLabelIs .WithLabel("gamma").WithIncrement(IncrementStrategy.Patch) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); fixture.MakeACommit(); @@ -924,7 +924,7 @@ public void IncreaseVersionWithBumpMessageWhenCommitMessageIncrementIsEnabledAnd ) .Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); // ✅ succeeds as expected @@ -964,7 +964,7 @@ public void IncreaseVersionWithBumpMessageWhenCommitMessageIncrementIsEnabledAnd .WithIsMainBranch(false) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); // ✅ succeeds as expected @@ -1044,7 +1044,7 @@ public void EnsureThePreReleaseTagIsCorrectlyGeneratedWhenPreReleaseLabelIsEmpty .WithDeploymentMode(DeploymentMode.ContinuousDelivery) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeCommits(5); var _ = fixture.GetVersion(configuration); @@ -1071,7 +1071,7 @@ public void EnsurePreventIncrementWhenCurrentCommitTaggedOnDevelopWithDeployment .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); if (!tag.IsNullOrEmpty()) fixture.ApplyTag(tag); fixture.BranchTo("develop"); @@ -1098,7 +1098,7 @@ public void EnsurePreventIncrementWhenCurrentCommitTaggedOnDevelopWithDeployment .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); if (!tag.IsNullOrEmpty()) fixture.ApplyTag(tag); fixture.BranchTo("develop"); @@ -1125,7 +1125,7 @@ public void EnsurePreventIncrementWhenCurrentCommitTaggedOnDevelopWithDeployment .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) ).Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); if (!tag.IsNullOrEmpty()) fixture.ApplyTag(tag); fixture.BranchTo("develop"); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs index 2e605dca8e..f1cefe017a 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs @@ -30,7 +30,7 @@ public void DoesNotTakeVersionFromNameOfNonReleaseBranch() [TestCase("hotfix")] public void DoesNotTakeVersionFromBranchWithAccidentalVersion(string branch) { - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); fixture.BranchTo($"{branch}/downgrade-some-lib-to-3.2.1"); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs index 616bf506c1..d78735900c 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs @@ -15,7 +15,7 @@ public void TagPreReleaseWeightIsNotConfigured_HeadIsATaggedCommit_WeightedPreRe .Build(); // Act - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.1.0"); var version = fixture.GetVersion(configuration); @@ -33,7 +33,7 @@ public void TagPreReleaseWeightIsConfigured_HeadIsATaggedCommit_WeightedPreRelea .Build(); // Act - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.1.0"); var version = fixture.GetVersion(configuration); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhen.cs index 1f9ebc1ac3..d6dde387bd 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhen.cs @@ -26,7 +26,7 @@ public void OneTimeSetUp() // |/ // * 58 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("develop"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable.cs index b1b05c1dc4..b2b7c500a9 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable.cs @@ -26,7 +26,7 @@ public void OneTimeSetUp() // |/ // * 58 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("develop"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainMergedBackToMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainMergedBackToMainWhen.cs index 59e6386fd8..6445d464cc 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainMergedBackToMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainMergedBackToMainWhen.cs @@ -31,7 +31,7 @@ public void OneTimeSetUp() // |/ // A 58 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainWhen.cs index 77b55990fa..8a794e8616 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainWhen.cs @@ -27,7 +27,7 @@ public void OneTimeSetUp() // |/ // A 58 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhen.cs index 36fbfc8383..99346fb127 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhen.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMajor.cs index 656cc1d362..79613c831f 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMajor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMajor.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: major"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMinor.cs index 2646ecd4b5..356e1c3021 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMinor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMinor.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: minor"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessagePatch.cs index 8245ca27ea..c23a133f91 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessagePatch.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessagePatch.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: patch"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreRelease.cs index 096e63cb84..db029d830d 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreRelease.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreRelease.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) (tag 0.0.0-4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseBar.cs index 23403c1a51..2197f87b0b 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseBar.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseBar.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) (tag 0.0.0-bar) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-bar"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseFoo.cs index ae40d134d1..ea7747aa59 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseFoo.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseFoo.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) (tag 0.0.0-foo.4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-foo.4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsStable.cs index e21ddc34af..9f3fd4fca8 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsStable.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) (tag 0.0.0) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMajor.cs index fea9c49462..a43ab72ee2 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMajor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMajor.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMinor.cs index 0230968690..c097da8bf1 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMinor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMinor.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessagePatch.cs index 7797492706..7e03c0029a 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessagePatch.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessagePatch.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreRelease.cs index fd3c88649e..b0dc36582c 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreRelease.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreRelease.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) (tag 0.0.0-4) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseBar.cs index 220cb1b99f..cf6bf5def1 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseBar.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseBar.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) (tag 0.0.0-bar) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseFoo.cs index dc2ac981d0..88f4b0c92e 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseFoo.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseFoo.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) (tag 0.0.0-foo.4) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsStable.cs index 348fc74350..12ea448041 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsStable.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 47 minutes ago (HEAD -> feature/foo) (tag 0.0.0) // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhen.cs index e98eb07ab0..8b7808d63f 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhen.cs @@ -26,7 +26,7 @@ public void OneTimeSetUp() // |/ // A 58 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreRelease.cs index 09851bfcf2..d7c028d45c 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreRelease.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreRelease.cs @@ -20,7 +20,7 @@ public class GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreR [OneTimeSetUp] public void OneTimeSetUp() { - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); // * 54 minutes ago (HEAD -> main) // |\ diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseBar.cs index c21f09f475..8711eaea64 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseBar.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseBar.cs @@ -20,7 +20,7 @@ public class GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreR [OneTimeSetUp] public void OneTimeSetUp() { - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); // * 55 minutes ago (HEAD -> main) // |\ diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseFoo.cs index 2c2cbd21ba..8ccdca3a5c 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseFoo.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseFoo.cs @@ -20,7 +20,7 @@ public class GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreR [OneTimeSetUp] public void OneTimeSetUp() { - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); // * 55 minutes ago (HEAD -> main) // |\ diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStable.cs index 9afb005f96..318456a731 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStable.cs @@ -20,7 +20,7 @@ public class GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStab [OneTimeSetUp] public void OneTimeSetUp() { - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); // * 55 minutes ago (HEAD -> main) // |\ diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWithOneCommitBranchedToFeatureWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWithOneCommitBranchedToFeatureWhen.cs index 44ac89da0f..d66ed5eea3 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWithOneCommitBranchedToFeatureWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWithOneCommitBranchedToFeatureWhen.cs @@ -27,7 +27,7 @@ public void OneTimeSetUp() // |/ // A 58 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsBranchedFromMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsBranchedFromMainWhen.cs index 7dfdc6fbf3..fad5196b3a 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsBranchedFromMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsBranchedFromMainWhen.cs @@ -25,7 +25,7 @@ public void OneTimeSetUp() // B 47 minutes ago // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsMergedToMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsMergedToMainWhen.cs index 4fff71e50c..18060a587a 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsMergedToMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsMergedToMainWhen.cs @@ -28,7 +28,7 @@ public void OneTimeSetUp() // |/ // A 58 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsBranchedFromMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsBranchedFromMainWhen.cs index d6c7d20ee6..d734f91b1b 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsBranchedFromMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsBranchedFromMainWhen.cs @@ -24,7 +24,7 @@ public void OneTimeSetUp() // B 47 minutes ago // A 51 minutes ago (main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsMergedToMainWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsMergedToMainWhen.cs index e967276bf6..96ff7c1d99 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsMergedToMainWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsMergedToMainWhen.cs @@ -27,7 +27,7 @@ public void OneTimeSetUp() // |/ // A 58 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhen.cs index a3e593d0c4..dd13044296 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhen.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() { // A 58 minutes ago (HEAD -> feature/foo, main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMajor.cs index 946b8dac40..342e335655 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMajor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMajor.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() { // A 58 minutes ago (HEAD -> feature/foo, main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: major"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMinor.cs index 8ab792eeac..a8bc27b841 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMinor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMinor.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() { // A 58 minutes ago (HEAD -> feature/foo, main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: minor"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessagePatch.cs index 55d9ed6277..1b53dcd4e1 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessagePatch.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessagePatch.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() { // A 58 minutes ago (HEAD -> feature/foo, main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: patch"); fixture.BranchTo("feature/foo"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreRelease.cs index 58b7310910..cf22d83b58 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreRelease.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreRelease.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() { // A 58 minutes ago (HEAD -> feature/foo, main) (tag 0.0.0-4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseBar.cs index 77034f847e..d6b5e15637 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseBar.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseBar.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() { // A 58 minutes ago (HEAD -> feature/foo, main) (tag 0.0.0-bar) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-bar"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseFoo.cs index 9d7121241d..883c900658 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseFoo.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseFoo.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() { // A 58 minutes ago (HEAD -> feature/foo, main) (tag 0.0.0-foo.4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-foo.4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsStable.cs index 41486e0754..a46910e703 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsStable.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() { // A 58 minutes ago (HEAD -> feature/foo, main) (tag 0.0.0) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhen.cs index 3e6257947a..10908de45a 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhen.cs @@ -21,7 +21,7 @@ public void OneTimeSetUp() { // A 59 minutes ago (HEAD -> main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); } diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs index 50ac4c58cb..e016a3633f 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs @@ -21,7 +21,7 @@ public void OneTimeSetUp() { // A 59 minutes ago (HEAD -> main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: major"); } diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs index b0b578915a..ab8ee19875 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs @@ -21,7 +21,7 @@ public void OneTimeSetUp() { // A 59 minutes ago (HEAD -> main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: minor"); } diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs index 57b2b50ed5..371606ec94 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs @@ -21,7 +21,7 @@ public void OneTimeSetUp() { // A 59 minutes ago (HEAD -> main) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: patch"); } diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs index 872a2b1c2f..48cf614d0f 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs @@ -21,7 +21,7 @@ public void OneTimeSetUp() { // A 59 minutes ago (HEAD -> main) (tag 0.0.0-4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs index 455b312395..77fb96cb38 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs @@ -21,7 +21,7 @@ public void OneTimeSetUp() { // A 59 minutes ago (HEAD -> main) (tag 0.0.0-bar) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-bar"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs index 6b0afcb49d..2d96a45c8b 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs @@ -21,7 +21,7 @@ public void OneTimeSetUp() { // A 59 minutes ago (HEAD -> main) (tag 0.0.0-foo.4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0-foo.4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsStable.cs index afa59167e9..b96c62a6af 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsStable.cs @@ -21,7 +21,7 @@ public void OneTimeSetUp() { // A 59 minutes ago (HEAD -> main) (tag 0.0.0) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.0"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithThreeCommitsWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithThreeCommitsWhen.cs index 44940742ec..9b82d11f7f 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithThreeCommitsWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithThreeCommitsWhen.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 58 minutes ago // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhen.cs index 86473801b3..47f2826def 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhen.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 54 minutes ago (main) (HEAD -> feature/foo) // A 56 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMajor.cs index 2563b590e5..cae332c393 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMajor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMajor.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 54 minutes ago (main) (HEAD -> feature/foo) // A 56 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: major"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMinor.cs index 69ad50d9e4..5e13f68ce1 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMinor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMinor.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 54 minutes ago (main) (HEAD -> feature/foo) // A 56 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: minor"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessagePatch.cs index bc7f3738f2..6c806e5549 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessagePatch.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessagePatch.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 54 minutes ago (main) (HEAD -> feature/foo) // A 56 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: patch"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreRelease.cs index e2abafa7a3..de3cb67f98 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreRelease.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreRelease.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 54 minutes ago (main) (HEAD -> feature/foo) // A 56 minutes ago (0.0.3-4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.3-4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseBar.cs index ddc87f80ed..cf89dbbf1f 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseBar.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseBar.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 54 minutes ago (main) (HEAD -> feature/foo) // A 56 minutes ago (0.0.3-bar) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.3-bar"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseFoo.cs index 9136a86378..21aa63002b 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseFoo.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseFoo.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 54 minutes ago (main) (HEAD -> feature/foo) // A 56 minutes ago (0.0.3-foo.4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.3-foo.4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsStable.cs index ddce4c502d..92fb7f6e77 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsStable.cs @@ -23,7 +23,7 @@ public void OneTimeSetUp() // B 54 minutes ago (main) (HEAD -> feature/foo) // A 56 minutes ago (0.0.3) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.3"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhen.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhen.cs index dfbf6f5977..9135837571 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhen.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhen.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMajor.cs index 3ed0c7586e..6752bc8a94 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMajor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMajor.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: major"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMinor.cs index e5ff33cfe0..c0ea1976e5 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMinor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMinor.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: minor"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessagePatch.cs index f4db1d0fa5..3a707f9fa0 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessagePatch.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessagePatch.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A +semver: patch"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs index ca9bc165d1..61ea406039 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago (tag 0.0.3-4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.3-4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs index 2b01bedaff..713dcaf723 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago (tag 0.0.3-bar) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.3-bar"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs index ec7c08a1bd..8693701841 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago (tag 0.0.3-foo.4) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.3-foo.4"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsStable.cs index 2218e0717d..30a5535474 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsStable.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago (tag 0.0.3) - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.ApplyTag("0.0.3"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMajor.cs index 23a55ce78e..a3e45161f5 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMajor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMajor.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B +semver: major"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMinor.cs index fa662a249c..4a236a3efb 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMinor.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMinor.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B +semver: minor"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessagePatch.cs index d956afcb4f..0e6f03bfcc 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessagePatch.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessagePatch.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B +semver: patch"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreRelease.cs index ab214954d7..6db3b80029 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreRelease.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreRelease.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) (tag 0.2.0-4) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseBar.cs index 3c2cd46deb..d561e33b67 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseBar.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseBar.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) (tag 0.2.0-bar) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseFoo.cs index cfdef73874..13e4d8f0fb 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseFoo.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseFoo.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) (tag 0.2.0-foo.4) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsStable.cs index d72069263c..fc773d91ab 100644 --- a/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsStable.cs +++ b/src/GitVersion.Core.Tests/TrunkBased/TrunkBasedScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsStable.cs @@ -22,7 +22,7 @@ public void OneTimeSetUp() // B 58 minutes ago (HEAD -> main) (tag 0.2.0) // A 59 minutes ago - fixture = new EmptyRepositoryFixture("main"); + fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("A"); fixture.MakeACommit("B"); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs index 5b9cbfe2e6..369ad1ade6 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs @@ -12,7 +12,7 @@ public class NextVersionCalculatorTests : TestBase [Test] public void ShouldIncrementVersionBasedOnConfig() { - var contextBuilder = new GitVersionContextBuilder(); + using var contextBuilder = new GitVersionContextBuilder(); contextBuilder.Build(); @@ -28,7 +28,7 @@ public void ShouldIncrementVersionBasedOnConfig() [Test] public void DoesNotIncrementWhenBaseVersionSaysNotTo() { - var contextBuilder = new GitVersionContextBuilder(); + using var contextBuilder = new GitVersionContextBuilder(); var overrideConfiguration = new Dictionary() { @@ -49,7 +49,7 @@ public void DoesNotIncrementWhenBaseVersionSaysNotTo() [Test] public void AppliesBranchPreReleaseTag() { - var contextBuilder = new GitVersionContextBuilder(); + using var contextBuilder = new GitVersionContextBuilder(); contextBuilder.WithDevelopBranch().Build(); @@ -89,7 +89,7 @@ public void PreReleaseVersionMainline() { var configuration = TrunkBasedConfigurationBuilder.New.Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.MakeACommit(); fixture.BranchTo("feature/foo"); @@ -125,7 +125,7 @@ public void MergeFeatureIntoMainline() { var configuration = TrunkBasedConfigurationBuilder.New.Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.ApplyTag("1.0.0"); fixture.AssertFullSemver("1.0.0", configuration); @@ -145,7 +145,7 @@ public void MergeHotfixIntoMainline() { var configuration = TrunkBasedConfigurationBuilder.New.Build(); - using var fixture = new EmptyRepositoryFixture("main"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.ApplyTag("1.0.0"); fixture.AssertFullSemver("1.0.0", configuration); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfiguredNextVersionVersionStrategyTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfiguredNextVersionVersionStrategyTests.cs index 142fec703e..1653766a3c 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfiguredNextVersionVersionStrategyTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfiguredNextVersionVersionStrategyTests.cs @@ -51,7 +51,7 @@ public void ConfiguredNextVersionTestShouldFail(string nextVersion, SemanticVers private static BaseVersion? GetBaseVersion(IReadOnlyDictionary? overrideConfiguration = null) { - var contextBuilder = new GitVersionContextBuilder().WithOverrideConfiguration(overrideConfiguration); + using var contextBuilder = new GitVersionContextBuilder().WithOverrideConfiguration(overrideConfiguration); contextBuilder.Build(); contextBuilder.ServicesProvider.ShouldNotBeNull(); var strategy = contextBuilder.ServicesProvider.GetServiceForType(); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs index 4911d9ac11..276e249753 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs @@ -27,7 +27,7 @@ public void ShouldNotAllowIncrementOfVersion() mockRepository.Branches.Returns(branches); mockRepository.Commits.Returns(mockBranch.Commits); - var contextBuilder = new GitVersionContextBuilder().WithRepository(mockRepository); + using var contextBuilder = new GitVersionContextBuilder().WithRepository(mockRepository); contextBuilder.Build(); contextBuilder.ServicesProvider.ShouldNotBeNull(); var strategy = contextBuilder.ServicesProvider.GetServiceForType(); @@ -156,7 +156,7 @@ private static void AssertMergeMessage(string message, string? expectedVersion, mockRepository.Head.Returns(mockBranch); mockRepository.Commits.Returns(mockBranch.Commits); - var contextBuilder = new GitVersionContextBuilder() + using var contextBuilder = new GitVersionContextBuilder() .WithOverrideConfiguration(configuration) .WithRepository(mockRepository); contextBuilder.Build(); diff --git a/src/GitVersion.Core/Core/Abstractions/IFileSystem.cs b/src/GitVersion.Core/Core/Abstractions/IFileSystem.cs index b316a76f7e..32e4646809 100644 --- a/src/GitVersion.Core/Core/Abstractions/IFileSystem.cs +++ b/src/GitVersion.Core/Core/Abstractions/IFileSystem.cs @@ -15,6 +15,4 @@ public interface IFileSystem void CreateDirectory(string path); bool DirectoryExists(string path); long GetLastDirectoryWrite(string path); - - bool PathsEqual(string? path, string? otherPath); } diff --git a/src/GitVersion.Core/Core/FileSystem.cs b/src/GitVersion.Core/Core/FileSystem.cs index fc253319fc..d3c41b59ea 100644 --- a/src/GitVersion.Core/Core/FileSystem.cs +++ b/src/GitVersion.Core/Core/FileSystem.cs @@ -52,10 +52,4 @@ public IEnumerable DirectoryEnumerateFiles(string? directory, string sea .DefaultIfEmpty() .Max() .Ticks; - - public bool PathsEqual(string? path, string? otherPath) => - string.Equals( - PathHelper.GetFullPath(path).TrimEnd('\\').TrimEnd('/'), - PathHelper.GetFullPath(otherPath).TrimEnd('\\').TrimEnd('/'), - StringComparerUtils.OsDependentComparison); } diff --git a/src/GitVersion.Core/Extensions/StringExtensions.cs b/src/GitVersion.Core/Extensions/StringExtensions.cs index dc10da112e..7fcd563d95 100644 --- a/src/GitVersion.Core/Extensions/StringExtensions.cs +++ b/src/GitVersion.Core/Extensions/StringExtensions.cs @@ -40,7 +40,7 @@ public static bool IsValidPath(this string? path) } public static bool IsSwitchArgument(this string? value) => value != null - && (value.StartsWith("-") || value.StartsWith("/")) + && (value.StartsWith('-') || value.StartsWith('/')) && !Regex.Match(value, @"/\w+:").Success; //Exclude msbuild & project parameters in form /blah:, which should be parsed as values, not switch names. public static bool IsSwitch(this string? value, string switchName) @@ -48,12 +48,12 @@ public static bool IsSwitch(this string? value, string switchName) if (value == null) return false; - if (value.StartsWith("-")) + if (value.StartsWith('-')) { value = value[1..]; } - if (value.StartsWith("/")) + if (value.StartsWith('/')) { value = value[1..]; } @@ -78,7 +78,7 @@ public static bool ArgumentRequiresValue(this string argument, int argumentIndex var argumentMightRequireValue = !booleanArguments.Contains(argument[1..], StringComparer.OrdinalIgnoreCase); // If this is the first argument that might be a target path, the argument starts with slash and we're on an OS that supports paths with slashes, the argument does not require a value. - if (argumentMightRequireValue && argumentIndex == 0 && argument.StartsWith("/") && Path.DirectorySeparatorChar == '/' && argument.IsValidPath()) + if (argumentMightRequireValue && argumentIndex == 0 && argument.StartsWith('/') && Path.DirectorySeparatorChar == '/' && argument.IsValidPath()) return false; return argumentMightRequireValue; diff --git a/src/GitVersion.Core/Logging/Disposable.cs b/src/GitVersion.Core/Helpers/Disposable.cs similarity index 94% rename from src/GitVersion.Core/Logging/Disposable.cs rename to src/GitVersion.Core/Helpers/Disposable.cs index e000bc2b22..af32a9fbc2 100644 --- a/src/GitVersion.Core/Logging/Disposable.cs +++ b/src/GitVersion.Core/Helpers/Disposable.cs @@ -1,6 +1,6 @@ using GitVersion.Extensions; -namespace GitVersion.Logging; +namespace GitVersion.Helpers; public static class Disposable { diff --git a/src/GitVersion.Core/Helpers/PathHelper.cs b/src/GitVersion.Core/Helpers/PathHelper.cs index cf26126f6b..2ba48e2638 100644 --- a/src/GitVersion.Core/Helpers/PathHelper.cs +++ b/src/GitVersion.Core/Helpers/PathHelper.cs @@ -4,6 +4,12 @@ internal static class PathHelper { public static string NewLine => SysEnv.NewLine; + public static readonly StringComparison OsDependentComparison = SysEnv.OSVersion.Platform switch + { + PlatformID.Unix or PlatformID.MacOSX => StringComparison.Ordinal, + _ => StringComparison.OrdinalIgnoreCase, + }; + public static string GetCurrentDirectory() => AppContext.BaseDirectory ?? throw new InvalidOperationException(); public static string GetTempPath() @@ -13,9 +19,12 @@ public static string GetTempPath() { tempPath = SysEnv.GetEnvironmentVariable("RUNNER_TEMP"); } - return Combine(tempPath, "TestRepositories", Guid.NewGuid().ToString()); + + return tempPath!; } + public static string GetRepositoryTempPath() => Combine(GetTempPath(), "TestRepositories", Guid.NewGuid().ToString()); + public static string GetFullPath(string? path) { ArgumentNullException.ThrowIfNull(path, nameof(path)); @@ -53,4 +62,10 @@ public static string Combine(string? path1, string? path2, string? path3, string return Path.Combine(path1, path2, path3, path4); } + + public static bool Equal(string? path, string? otherPath) => + string.Equals( + GetFullPath(path).TrimEnd('\\').TrimEnd('/'), + GetFullPath(otherPath).TrimEnd('\\').TrimEnd('/'), + OsDependentComparison); } diff --git a/src/GitVersion.Core/Helpers/StringComparerUtils.cs b/src/GitVersion.Core/Helpers/StringComparerUtils.cs deleted file mode 100644 index 3d70257962..0000000000 --- a/src/GitVersion.Core/Helpers/StringComparerUtils.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace GitVersion.Helpers; - -public static class StringComparerUtils -{ - public static readonly StringComparer IgnoreCaseComparer = StringComparer.InvariantCultureIgnoreCase; - public static readonly StringComparison OsDependentComparison = SysEnv.OSVersion.Platform == PlatformID.Unix ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase; - public static readonly StringComparer OsDependentComparer = SysEnv.OSVersion.Platform == PlatformID.Unix ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase; -} diff --git a/src/GitVersion.Core/Logging/ConsoleAdapter.cs b/src/GitVersion.Core/Logging/ConsoleAdapter.cs index 1fe87c09fe..7f6f69c760 100644 --- a/src/GitVersion.Core/Logging/ConsoleAdapter.cs +++ b/src/GitVersion.Core/Logging/ConsoleAdapter.cs @@ -1,3 +1,5 @@ +using GitVersion.Helpers; + namespace GitVersion.Logging; internal class ConsoleAdapter : IConsole diff --git a/src/GitVersion.Core/Logging/FileAppender.cs b/src/GitVersion.Core/Logging/FileAppender.cs index a9f9a9a3d1..a5c8f56a78 100644 --- a/src/GitVersion.Core/Logging/FileAppender.cs +++ b/src/GitVersion.Core/Logging/FileAppender.cs @@ -12,7 +12,6 @@ public FileAppender(string filePath) var logFile = new FileInfo(Path.GetFullPath(filePath)); - // NOTE: logFile.Directory will be null if the path is i.e. C:\logfile.log. @asbjornu logFile.Directory?.Create(); if (logFile.Exists) return; diff --git a/src/GitVersion.Core/Logging/Log.cs b/src/GitVersion.Core/Logging/Log.cs index 030760d0b7..b1d9f9cfdb 100644 --- a/src/GitVersion.Core/Logging/Log.cs +++ b/src/GitVersion.Core/Logging/Log.cs @@ -1,5 +1,6 @@ using System.Globalization; using System.Text.RegularExpressions; +using GitVersion.Helpers; namespace GitVersion.Logging; diff --git a/src/GitVersion.Core/Logging/LogExtensions.cs b/src/GitVersion.Core/Logging/LogExtensions.cs index 945f89332e..d88a5ef5c6 100644 --- a/src/GitVersion.Core/Logging/LogExtensions.cs +++ b/src/GitVersion.Core/Logging/LogExtensions.cs @@ -1,3 +1,5 @@ +using GitVersion.Helpers; + namespace GitVersion.Logging; public static class LogExtensions diff --git a/src/GitVersion.Core/Logging/NullLog.cs b/src/GitVersion.Core/Logging/NullLog.cs index 2acb1a6079..8a311f8cc2 100644 --- a/src/GitVersion.Core/Logging/NullLog.cs +++ b/src/GitVersion.Core/Logging/NullLog.cs @@ -1,3 +1,5 @@ +using GitVersion.Helpers; + namespace GitVersion.Logging; internal sealed class NullLog : ILog diff --git a/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs b/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs index df86aa8d4d..53a8b55172 100644 --- a/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs +++ b/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs @@ -26,7 +26,7 @@ public record GitVersionVariables(string Major, string? CommitsSinceVersionSource, string? UncommittedChanges) : IEnumerable> { - public static readonly List AvailableVariables = + internal static readonly List AvailableVariables = [ nameof(Major), nameof(Minor), diff --git a/src/GitVersion.Core/PublicAPI.Unshipped.txt b/src/GitVersion.Core/PublicAPI.Unshipped.txt index 7902498b8a..cf65d62637 100644 --- a/src/GitVersion.Core/PublicAPI.Unshipped.txt +++ b/src/GitVersion.Core/PublicAPI.Unshipped.txt @@ -275,6 +275,7 @@ GitVersion.GitVersionOptions.Verbosity -> GitVersion.Logging.Verbosity GitVersion.GitVersionOptions.WixInfo.get -> GitVersion.WixInfo! GitVersion.GitVersionOptions.WorkingDirectory.get -> string! GitVersion.GitVersionOptions.WorkingDirectory.set -> void +GitVersion.Helpers.Disposable GitVersion.Helpers.EncodingHelper GitVersion.Helpers.LambdaEqualityHelper GitVersion.Helpers.LambdaEqualityHelper.Equals(T? instance, T? other) -> bool @@ -289,7 +290,6 @@ GitVersion.Helpers.RetryAction GitVersion.Helpers.RetryAction.Execute(System.Action! operation) -> void GitVersion.Helpers.RetryAction.RetryAction(int maxRetries = 5) -> void GitVersion.Helpers.ServiceMessageEscapeHelper -GitVersion.Helpers.StringComparerUtils GitVersion.IBranch GitVersion.IBranch.Commits.get -> GitVersion.ICommitCollection! GitVersion.IBranch.IsDetachedHead.get -> bool @@ -324,7 +324,6 @@ GitVersion.IFileSystem.GetLastDirectoryWrite(string! path) -> long GitVersion.IFileSystem.Move(string! from, string! to) -> void GitVersion.IFileSystem.OpenRead(string! path) -> System.IO.Stream! GitVersion.IFileSystem.OpenWrite(string! path) -> System.IO.Stream! -GitVersion.IFileSystem.PathsEqual(string? path, string? otherPath) -> bool GitVersion.IFileSystem.ReadAllText(string! path) -> string! GitVersion.IFileSystem.WriteAllText(string? file, string! fileContents) -> void GitVersion.IFileSystem.WriteAllText(string? file, string! fileContents, System.Text.Encoding! encoding) -> void @@ -414,7 +413,6 @@ GitVersion.LockedFileException.LockedFileException() -> void GitVersion.LockedFileException.LockedFileException(System.Exception! inner) -> void GitVersion.LockedFileException.LockedFileException(string? message) -> void GitVersion.LockedFileException.LockedFileException(string? message, System.Exception? innerException) -> void -GitVersion.Logging.Disposable GitVersion.Logging.IConsole GitVersion.Logging.IConsole.ReadLine() -> string? GitVersion.Logging.IConsole.UseColor(System.ConsoleColor consoleColor) -> System.IDisposable! @@ -822,11 +820,11 @@ static GitVersion.Extensions.StringExtensions.IsTrue(this string? value) -> bool static GitVersion.Extensions.StringExtensions.IsValidPath(this string? path) -> bool static GitVersion.Extensions.StringExtensions.RegexReplace(this string! input, string! pattern, string! replace, System.Text.RegularExpressions.RegexOptions options = System.Text.RegularExpressions.RegexOptions.None) -> string! static GitVersion.Extensions.StringExtensions.WithPrefixIfNotNullOrEmpty(this string! value, string! prefix) -> string! +static GitVersion.Helpers.Disposable.Create(System.Action! disposer) -> System.IDisposable! static GitVersion.Helpers.EncodingHelper.DetectEncoding(System.Collections.Generic.IList! bytes) -> System.Text.Encoding? static GitVersion.Helpers.EncodingHelper.DetectEncoding(string? filename) -> System.Text.Encoding? static GitVersion.Helpers.ServiceMessageEscapeHelper.EscapeValue(string? value) -> string? static GitVersion.IncrementStrategyExtensions.ToVersionField(this GitVersion.IncrementStrategy strategy) -> GitVersion.VersionField -static GitVersion.Logging.Disposable.Create(System.Action! disposer) -> System.IDisposable! static GitVersion.Logging.LogExtensions.Debug(this GitVersion.Logging.ILog! log, GitVersion.Logging.LogAction! logAction) -> void static GitVersion.Logging.LogExtensions.Debug(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogAction! logAction) -> void static GitVersion.Logging.LogExtensions.Debug(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, string! format, params object![]! args) -> void @@ -887,11 +885,7 @@ static GitVersion.VersionCalculation.NextVersion.operator ==(GitVersion.VersionC static GitVersion.VersionCalculation.NextVersion.operator >(GitVersion.VersionCalculation.NextVersion! left, GitVersion.VersionCalculation.NextVersion! right) -> bool static GitVersion.VersionCalculation.NextVersion.operator >=(GitVersion.VersionCalculation.NextVersion! left, GitVersion.VersionCalculation.NextVersion! right) -> bool static readonly GitVersion.BranchCommit.Empty -> GitVersion.BranchCommit -static readonly GitVersion.Helpers.StringComparerUtils.IgnoreCaseComparer -> System.StringComparer! -static readonly GitVersion.Helpers.StringComparerUtils.OsDependentComparer -> System.StringComparer! -static readonly GitVersion.Helpers.StringComparerUtils.OsDependentComparison -> System.StringComparison -static readonly GitVersion.Logging.Disposable.Empty -> System.IDisposable! -static readonly GitVersion.OutputVariables.GitVersionVariables.AvailableVariables -> System.Collections.Generic.List! +static readonly GitVersion.Helpers.Disposable.Empty -> System.IDisposable! static readonly GitVersion.SemanticVersion.Empty -> GitVersion.SemanticVersion! static readonly GitVersion.SemanticVersionBuildMetaData.Empty -> GitVersion.SemanticVersionBuildMetaData! static readonly GitVersion.SemanticVersionPreReleaseTag.Empty -> GitVersion.SemanticVersionPreReleaseTag! diff --git a/src/GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs b/src/GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs index 930773dd9e..dff27ee621 100644 --- a/src/GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs +++ b/src/GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs @@ -8,6 +8,7 @@ namespace GitVersion; public sealed class SemanticVersionPreReleaseTag : IFormattable, IComparable, IEquatable { + private static readonly StringComparer IgnoreCaseComparer = StringComparer.InvariantCultureIgnoreCase; public static readonly SemanticVersionPreReleaseTag Empty = new(); private static readonly Regex ParseRegex = new( @@ -63,7 +64,7 @@ public SemanticVersionPreReleaseTag(SemanticVersionPreReleaseTag preReleaseTag) left?.CompareTo(right) >= 0; public static bool operator <=(SemanticVersionPreReleaseTag? left, SemanticVersionPreReleaseTag? right) => - StringComparerUtils.IgnoreCaseComparer.Compare(left?.Name, right?.Name) != 1; + IgnoreCaseComparer.Compare(left?.Name, right?.Name) != 1; public static implicit operator string?(SemanticVersionPreReleaseTag? preReleaseTag) => preReleaseTag?.ToString(); @@ -83,7 +84,7 @@ public static SemanticVersionPreReleaseTag Parse(string? preReleaseTag) var value = match.Groups["name"].Value; var number = match.Groups["number"].Success ? long.Parse(match.Groups["number"].Value) : (long?)null; - return value.EndsWith("-") + return value.EndsWith('-') ? new(preReleaseTag, null, true) : new SemanticVersionPreReleaseTag(value, number, true); } @@ -99,7 +100,7 @@ public int CompareTo(SemanticVersionPreReleaseTag? other) return -1; } - var nameComparison = StringComparerUtils.IgnoreCaseComparer.Compare(Name, other?.Name); + var nameComparison = IgnoreCaseComparer.Compare(Name, other?.Name); return nameComparison != 0 ? nameComparison : Nullable.Compare(Number, other?.Number); } @@ -123,7 +124,7 @@ public string ToString(string? format, IFormatProvider? formatProvider) return format switch { - "t" => (Number.HasValue ? Name.IsNullOrEmpty() ? $"{Number}" : $"{Name}.{Number}" : Name ?? string.Empty), + "t" => (Number.HasValue ? Name.IsNullOrEmpty() ? $"{Number}" : $"{Name}.{Number}" : Name), _ => throw new FormatException($"Unknown format '{format}'.") }; } diff --git a/src/GitVersion.MsBuild.Tests/InvalidFileCheckerTests.cs b/src/GitVersion.MsBuild.Tests/InvalidFileCheckerTests.cs index 16ff51d5fa..12b6315a1e 100644 --- a/src/GitVersion.MsBuild.Tests/InvalidFileCheckerTests.cs +++ b/src/GitVersion.MsBuild.Tests/InvalidFileCheckerTests.cs @@ -14,7 +14,7 @@ public class InvalidFileCheckerTests : TestBase [SetUp] public void CreateTemporaryProject() { - this.projectDirectory = PathHelper.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); + this.projectDirectory = PathHelper.Combine(PathHelper.GetTempPath(), Guid.NewGuid().ToString()); this.projectFile = PathHelper.Combine(this.projectDirectory, "Fake.csproj"); Directory.CreateDirectory(this.projectDirectory); diff --git a/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs index 76e235d3ad..82faa1483f 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs @@ -1,3 +1,4 @@ +using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using GitVersion.MsBuild.Tasks; using GitVersion.MsBuild.Tests.Helpers; @@ -133,6 +134,7 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenIntermediateOut fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "4")); fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")); fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.2.4-1")); + DirectoryHelper.DeleteDirectory(task.IntermediateOutputPath); } [TestCaseSource(nameof(Languages))] @@ -154,6 +156,7 @@ public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServerWhenIn fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "1")); fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.0.1")); fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.0.1-1")); + DirectoryHelper.DeleteDirectory(task.IntermediateOutputPath); } [TestCaseSource(nameof(Languages))] diff --git a/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs index b382d0ade4..6f5121a2f1 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs @@ -1,3 +1,4 @@ +using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using GitVersion.MsBuild.Tasks; using GitVersion.MsBuild.Tests.Helpers; @@ -111,6 +112,7 @@ public void UpdateAssemblyInfoTaskShouldCreateFileWhenIntermediateOutputPathDoes var fileContent = File.ReadAllText(result.Task.AssemblyInfoTempFilePath); fileContent.ShouldContain(@"assembly: AssemblyVersion(""1.2.4.0"")"); + DirectoryHelper.DeleteDirectory(task.IntermediateOutputPath); } [TestCaseSource(nameof(Languages))] @@ -128,6 +130,7 @@ public void UpdateAssemblyInfoTaskShouldCreateFileWhenIntermediateOutputPathDoes var fileContent = File.ReadAllText(result.Task.AssemblyInfoTempFilePath); fileContent.ShouldContain(@"assembly: AssemblyVersion(""1.0.1.0"")"); + DirectoryHelper.DeleteDirectory(task.IntermediateOutputPath); } [TestCaseSource(nameof(Languages))] diff --git a/src/GitVersion.MsBuild/Helpers/MsBuildAdapter.cs b/src/GitVersion.MsBuild/Helpers/MsBuildAdapter.cs index 9243e1f470..7acb755607 100644 --- a/src/GitVersion.MsBuild/Helpers/MsBuildAdapter.cs +++ b/src/GitVersion.MsBuild/Helpers/MsBuildAdapter.cs @@ -1,3 +1,4 @@ +using GitVersion.Helpers; using GitVersion.Logging; using Microsoft.Build.Utilities; diff --git a/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs index 04c0a2b193..1d576d0dd8 100644 --- a/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs @@ -17,6 +17,13 @@ public class AssemblyInfoFileUpdaterTests : TestBase private IVariableProvider variableProvider; private ILog log; private IFileSystem fileSystem; + private string workingDir; + + [OneTimeSetUp] + public void OneTimeSetUp() => workingDir = PathHelper.Combine(PathHelper.GetTempPath(), "AssemblyInfoFileUpdaterTests"); + + [OneTimeTearDown] + public void OneTimeTearDown() => DirectoryHelper.DeleteDirectory(workingDir); [SetUp] public void Setup() @@ -35,7 +42,6 @@ public void Setup() [TestCase("vb")] public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -53,7 +59,6 @@ public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(strin [TestCase("vb")] public void ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = PathHelper.Combine("src", "Project", "Properties", $"VersionAssemblyInfo.{fileExtension}"); var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); var variables = this.variableProvider.GetVariablesFor( @@ -71,12 +76,7 @@ public void ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo [TestCase("vb")] public void ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { - var workingDir = Path.GetTempPath(); - var assemblyInfoFiles = new HashSet - { - "AssemblyInfo." + fileExtension, - PathHelper.Combine("src", "Project", "Properties", "VersionAssemblyInfo." + fileExtension) - }; + var assemblyInfoFiles = new HashSet { "AssemblyInfo." + fileExtension, PathHelper.Combine("src", "Project", "Properties", "VersionAssemblyInfo." + fileExtension) }; var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultTagPrefix), EmptyConfigurationBuilder.New.Build(), 0); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); @@ -94,7 +94,6 @@ public void ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInf [TestCase("vb")] public void ShouldNotCreateAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo(string fileExtension) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); var variables = this.variableProvider.GetVariablesFor( @@ -111,7 +110,7 @@ public void ShouldNotCreateAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo public void ShouldNotCreateAssemblyInfoFileForUnknownSourceCodeAndEnsureAssemblyInfo() { this.fileSystem = Substitute.For(); - var workingDir = Path.GetTempPath(); + const string assemblyInfoFile = "VersionAssemblyInfo.js"; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); var variables = this.variableProvider.GetVariablesFor( @@ -128,7 +127,7 @@ public void ShouldNotCreateAssemblyInfoFileForUnknownSourceCodeAndEnsureAssembly public void ShouldStartSearchFromWorkingDirectory() { this.fileSystem = Substitute.For(); - var workingDir = Path.GetTempPath(); + string[] assemblyInfoFiles = []; var variables = this.variableProvider.GetVariablesFor( SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultTagPrefix), EmptyConfigurationBuilder.New.Build(), 0 @@ -145,7 +144,6 @@ public void ShouldStartSearchFromWorkingDirectory() [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersion(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -166,7 +164,6 @@ public void ShouldReplaceAssemblyVersion(string fileExtension, string assemblyFi [TestCase("vb", "")] public void ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -185,7 +182,6 @@ public void ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone(string fileEx [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionInRelativePath(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = PathHelper.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -206,7 +202,6 @@ public void ShouldReplaceAssemblyVersionInRelativePath(string fileExtension, str [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionInRelativePathWithWhiteSpace(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = PathHelper.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -227,7 +222,6 @@ public void ShouldReplaceAssemblyVersionInRelativePathWithWhiteSpace(string file [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionWithStar(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -248,7 +242,6 @@ public void ShouldReplaceAssemblyVersionWithStar(string fileExtension, string as [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionWithAttributeSuffix(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -272,7 +265,6 @@ public void ShouldReplaceAssemblyVersionWithAttributeSuffix(string fileExtension [TestCase("vb")] public void ShouldAddAssemblyVersionIfMissingFromInfoFile(string fileExtension) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -293,7 +285,6 @@ public void ShouldAddAssemblyVersionIfMissingFromInfoFile(string fileExtension) [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAlreadySubstitutedValues(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -314,7 +305,6 @@ public void ShouldReplaceAlreadySubstitutedValues(string fileExtension, string a [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionWhenCreatingAssemblyVersionFileAndEnsureAssemblyInfo(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -335,7 +325,6 @@ public void ShouldReplaceAssemblyVersionWhenCreatingAssemblyVersionFileAndEnsure [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionInRelativePathWithVariables(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = PathHelper.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -356,7 +345,6 @@ public void ShouldReplaceAssemblyVersionInRelativePathWithVariables(string fileE [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionInRelativePathWithVariablesAndWhiteSpace(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = PathHelper.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -377,7 +365,6 @@ public void ShouldReplaceAssemblyVersionInRelativePathWithVariablesAndWhiteSpace [TestCase("vb", "\r\n")] public void ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -396,7 +383,6 @@ public void ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile [TestCase("vb", "\r\n\r\n' comment\r\n")] public void Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -415,7 +401,6 @@ public void Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttri [TestCase("vb", "")] public void ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); @@ -436,13 +421,7 @@ private void VerifyAssemblyInfoFile( Action? verify = null) { this.fileSystem = Substitute.For(); - var version = new SemanticVersion - { - BuildMetaData = new("versionSourceHash", 3, "foo", "hash", "shortHash", DateTimeOffset.Now, 0), - Major = 2, - Minor = 3, - Patch = 1 - }; + var version = new SemanticVersion { BuildMetaData = new("versionSourceHash", 3, "foo", "hash", "shortHash", DateTimeOffset.Now, 0), Major = 2, Minor = 3, Patch = 1 }; this.fileSystem.Exists(fileName).Returns(true); this.fileSystem.ReadAllText(fileName).Returns(assemblyFileContent); diff --git a/src/GitVersion.Output.Tests/Output/FormatArgumentTests.cs b/src/GitVersion.Output.Tests/Output/FormatArgumentTests.cs index eed8929088..84e0180350 100644 --- a/src/GitVersion.Output.Tests/Output/FormatArgumentTests.cs +++ b/src/GitVersion.Output.Tests/Output/FormatArgumentTests.cs @@ -16,7 +16,7 @@ public class FormatArgumentTests : TestBase [TestCase("{Major}.{Minor}.{Patch}.{PreReleaseTag}", "1.1.0.foo.1")] public void ShouldOutputFormatTests(string format, string expectedValue) { - var fixture = CreateTestRepository(); + using var fixture = CreateTestRepository(); var consoleBuilder = new StringBuilder(); IConsole consoleAdapter = new TestConsoleAdapter(consoleBuilder); @@ -49,7 +49,7 @@ public void ShouldOutputFormatTests(string format, string expectedValue) [TestCase("{Major}.{Minor}.{Patch}.{env:CustomVar}", "1.1.0.foo")] public void ShouldOutputFormatWithEnvironmentVariablesTests(string format, string expectedValue) { - var fixture = CreateTestRepository(); + using var fixture = CreateTestRepository(); var consoleBuilder = new StringBuilder(); IConsole console = new TestConsoleAdapter(consoleBuilder); IEnvironment environment = new TestEnvironment(); diff --git a/src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs b/src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs index ddcdac7477..54a250d84d 100644 --- a/src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs +++ b/src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs @@ -19,7 +19,7 @@ public class GitVersionInfoGeneratorTests : TestBase [TestCase("vb")] public void ShouldCreateFile(string fileExtension) { - var directory = Path.GetTempPath(); + var directory = Path.Combine(PathHelper.GetTempPath(), "GitVersionInfoGeneratorTests", Guid.NewGuid().ToString()); var fileName = "GitVersionInformation.g." + fileExtension; var fullPath = PathHelper.Combine(directory, fileName); @@ -44,5 +44,7 @@ public void ShouldCreateFile(string fileExtension) generator.Execute(variables, new(directory, fileName, fileExtension)); fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); + + DirectoryHelper.DeleteDirectory(directory); } } diff --git a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs index 38b1dc6ca1..9a3d6b5790 100644 --- a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs +++ b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs @@ -259,12 +259,13 @@ public void UpdateProjectXmlVersionElementWithMultipleVersionElementsLastOneIsMo ")] public void UpdateProjectFileAddsVersionToFile(string xml) { - var fileName = PathHelper.Combine(Path.GetTempPath(), "TestProject.csproj"); + var workingDirectory = PathHelper.GetTempPath(); + var fileName = PathHelper.Combine(workingDirectory, "TestProject.csproj"); VerifyAssemblyInfoFile(xml, fileName, AssemblyVersioningScheme.MajorMinorPatch, (fs, variables) => { using var projFileUpdater = new ProjectFileUpdater(this.log, fs); - projFileUpdater.Execute(variables, new(Path.GetTempPath(), false, fileName)); + projFileUpdater.Execute(variables, new(workingDirectory, false, fileName)); const string expectedXml = @" diff --git a/src/GitVersion.Output.Tests/Output/WixFileTests.cs b/src/GitVersion.Output.Tests/Output/WixFileTests.cs index 2efa241867..4d41fec15b 100644 --- a/src/GitVersion.Output.Tests/Output/WixFileTests.cs +++ b/src/GitVersion.Output.Tests/Output/WixFileTests.cs @@ -12,13 +12,20 @@ namespace GitVersion.Core.Tests; [Parallelizable(ParallelScope.None)] internal class WixFileTests : TestBase { + private string workingDir; + + [OneTimeSetUp] + public void OneTimeSetUp() => workingDir = PathHelper.Combine(PathHelper.GetTempPath(), "WixFileTests"); + + [OneTimeTearDown] + public void OneTimeTearDown() => DirectoryHelper.DeleteDirectory(workingDir); + [SetUp] public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); [Test] public void UpdateWixVersionFile() { - var workingDir = Path.GetTempPath(); var semVer = new SemanticVersion { Major = 1, @@ -58,7 +65,6 @@ public void UpdateWixVersionFile() [Test] public void UpdateWixVersionFileWhenFileAlreadyExists() { - var workingDir = Path.GetTempPath(); var semVer = new SemanticVersion { Major = 1, diff --git a/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs index 5d4c263054..2756280988 100644 --- a/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs +++ b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs @@ -56,7 +56,9 @@ public void Execute(GitVersionVariables variables, GitVersionInfoContext context this.fileSystem.WriteAllText(filePath, fileContents); } - string getTargetNamespace(string fileExtension) => fileExtension switch + return; + + string getTargetNamespace(string extension) => extension switch { ".vb" => context.TargetNamespace ?? "Global", ".cs" => context.TargetNamespace != null ? $"{PathHelper.NewLine}namespace {context.TargetNamespace};" : "", diff --git a/src/GitVersion.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs b/src/GitVersion.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs index 650d09a562..2775194b88 100644 --- a/src/GitVersion.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs +++ b/src/GitVersion.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs @@ -11,15 +11,7 @@ public class BaseGitFlowRepositoryFixture : EmptyRepositoryFixture /// Creates a repo with a develop branch off main which is a single commit ahead of main /// Main will be tagged with the initial version before branching develop /// - public BaseGitFlowRepositoryFixture(string initialVersion) : this(initialVersion, "main") - { - } - - /// - /// Creates a repo with a develop branch off main which is a single commit ahead of main - /// Main will be tagged with the initial version before branching develop - /// - public BaseGitFlowRepositoryFixture(string initialVersion, string branchName) : + public BaseGitFlowRepositoryFixture(string initialVersion, string branchName = "main") : this(r => r.MakeATaggedCommit(initialVersion), branchName) { } @@ -28,15 +20,7 @@ public BaseGitFlowRepositoryFixture(string initialVersion, string branchName) : /// Creates a repo with a develop branch off main which is a single commit ahead of main /// The initial setup actions will be performed before branching develop /// - public BaseGitFlowRepositoryFixture(Action initialMainAction) : this(initialMainAction, "main") - { - } - - /// - /// Creates a repo with a develop branch off main which is a single commit ahead of main - /// The initial setup actions will be performed before branching develop - /// - public BaseGitFlowRepositoryFixture(Action initialMainAction, string branchName) : + public BaseGitFlowRepositoryFixture(Action initialMainAction, string branchName = "main") : base(branchName) => SetupRepo(initialMainAction); private void SetupRepo(Action initialMainAction) diff --git a/src/GitVersion.Testing/Fixtures/EmptyRepositoryFixture.cs b/src/GitVersion.Testing/Fixtures/EmptyRepositoryFixture.cs index b345b887e3..b864b31247 100644 --- a/src/GitVersion.Testing/Fixtures/EmptyRepositoryFixture.cs +++ b/src/GitVersion.Testing/Fixtures/EmptyRepositoryFixture.cs @@ -1,18 +1,3 @@ -using LibGit2Sharp; - namespace GitVersion.Testing; -public class EmptyRepositoryFixture(string branchName) : RepositoryFixtureBase(path => CreateNewRepository(path, branchName)) -{ - public EmptyRepositoryFixture() : this("main") - { - } - - private static Repository CreateNewRepository(string path, string branchName) - { - Init(path, branchName); - Console.WriteLine("Created git repository at '{0}'", path); - - return new Repository(path); - } -} +public class EmptyRepositoryFixture(string branchName = "main") : RepositoryFixtureBase(path => CreateNewRepository(path, branchName)); diff --git a/src/GitVersion.Testing/Fixtures/RemoteRepositoryFixture.cs b/src/GitVersion.Testing/Fixtures/RemoteRepositoryFixture.cs index 9ba142908d..57c3a53f3e 100644 --- a/src/GitVersion.Testing/Fixtures/RemoteRepositoryFixture.cs +++ b/src/GitVersion.Testing/Fixtures/RemoteRepositoryFixture.cs @@ -10,14 +10,10 @@ namespace GitVersion.Testing; public class RemoteRepositoryFixture : RepositoryFixtureBase { public RemoteRepositoryFixture(Func builder) - : base(builder) => CreateLocalRepository(); + : base(builder) => LocalRepositoryFixture = CloneRepository(); - public RemoteRepositoryFixture() : this("main") - { - } - - public RemoteRepositoryFixture(string branchName) - : this(path => CreateNewRepository(path, branchName)) + public RemoteRepositoryFixture(string branchName = "main") + : this(path => CreateNewRepository(path, branchName, 5)) { } @@ -26,18 +22,6 @@ public RemoteRepositoryFixture(string branchName) /// public LocalRepositoryFixture LocalRepositoryFixture { get; private set; } - private static Repository CreateNewRepository(string path, string branchName) - { - Init(path, branchName); - Console.WriteLine("Created git repository at '{0}'", path); - - var repository = new Repository(path); - repository.MakeCommits(5); - return repository; - } - - private void CreateLocalRepository() => LocalRepositoryFixture = CloneRepository(); - /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// @@ -47,7 +31,6 @@ protected override void Dispose(bool disposing) { LocalRepositoryFixture.Dispose(); } - base.Dispose(disposing); } } diff --git a/src/GitVersion.Testing/Fixtures/RepositoryFixtureBase.cs b/src/GitVersion.Testing/Fixtures/RepositoryFixtureBase.cs index 79375ff324..74aa84e7ff 100644 --- a/src/GitVersion.Testing/Fixtures/RepositoryFixtureBase.cs +++ b/src/GitVersion.Testing/Fixtures/RepositoryFixtureBase.cs @@ -10,13 +10,13 @@ namespace GitVersion.Testing; public abstract class RepositoryFixtureBase : IDisposable { protected RepositoryFixtureBase(Func repositoryBuilder) - : this(repositoryBuilder(PathHelper.GetTempPath())) + : this(repositoryBuilder(PathHelper.GetRepositoryTempPath())) { } protected RepositoryFixtureBase(Repository repository) { - this.SequenceDiagram = new SequenceDiagram(); + SequenceDiagram = new(); Repository = repository ?? throw new ArgumentNullException(nameof(repository)); Repository.Config.Set("user.name", "Test"); Repository.Config.Set("user.email", "test@email.com"); @@ -45,15 +45,18 @@ protected virtual void Dispose(bool disposing) } Repository.Dispose(); + var directoryPath = Path.GetFileName(RepositoryPath); try { + Console.WriteLine("Cleaning up repository path at {0}", directoryPath); DirectoryHelper.DeleteDirectory(RepositoryPath); + Console.WriteLine("Cleaned up repository path at {0}", directoryPath); } catch (Exception e) { - Console.WriteLine("Failed to clean up repository path at {0}. Received exception: {1}", RepositoryPath, - e.Message); + Console.WriteLine("Failed to clean up repository path at {0}. Received exception: {1}", directoryPath, e.Message); + // throw; } this.SequenceDiagram.End(); @@ -66,7 +69,7 @@ protected virtual void Dispose(bool disposing) public void Remove(string branch) => Repository.Branches.Remove(branch); - public static void Init(string path, string branchName) => GitTestExtensions.ExecuteGitCmd($"init {path} -b {branchName}"); + public static void Init(string path, string branchName = "main") => GitTestExtensions.ExecuteGitCmd($"init {path} -b {branchName}"); public string MakeATaggedCommit(string tag) { @@ -134,11 +137,25 @@ public void MergeTo(string branchName, bool removeBranchAfterMerging = false) /// public LocalRepositoryFixture CloneRepository() { - var localPath = PathHelper.GetTempPath(); + var localPath = PathHelper.GetRepositoryTempPath(); Repository.Clone(RepositoryPath, localPath); + Console.WriteLine($"Cloned repository to '{localPath}' from '{RepositoryPath}'"); return new LocalRepositoryFixture(new Repository(localPath)); } + protected static Repository CreateNewRepository(string path, string branchName, int commits = 0) + { + Init(path, branchName); + Console.WriteLine("Created git repository at '{0}'", path); + + var repository = new Repository(path); + if (commits > 0) + { + repository.MakeCommits(commits); + } + return repository; + } + /// /// Pulls with a depth of 1 and prunes all older commits, making the repository shallow. ///