From e26eb6a3500a77d0e2ebd46aaacea54352943ea6 Mon Sep 17 00:00:00 2001 From: Tomasz Maciejczyk Date: Tue, 23 Jun 2020 10:34:16 +0200 Subject: [PATCH 1/2] Added Test for checking Hotfix branch name as Version source --- .../IntegrationTests/HotfixBranchScenarios.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs b/src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs index ea9b885a66..fa7c5995c0 100644 --- a/src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs +++ b/src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs @@ -227,5 +227,24 @@ public void FeatureOnHotfixFeatureBranchNotDeleted() fixture.AssertFullSemver("4.5.1-beta.2", config); } + [Test] + public void IsVersionTakenFromHotfixBranchName() + { + using var fixture = new BaseGitFlowRepositoryFixture("4.20.4"); + + Commands.Checkout(fixture.Repository, "develop"); + fixture.AssertFullSemver("4.21.0-alpha.1"); + + fixture.Repository.CreateBranch("release/4.21.1"); + Commands.Checkout(fixture.Repository, "release/4.21.1"); + fixture.AssertFullSemver("4.21.1-beta.1+0"); + + fixture.Repository.CreateBranch("hotfix/4.21.1"); + Commands.Checkout(fixture.Repository, "hotfix/4.21.1"); + fixture.Repository.MakeACommit("hotfix test"); + + fixture.AssertFullSemver("4.21.1-beta.1+0"); + } + } } From 64eb07bb566ceec8dfea7c576ec3aca629ff8a36 Mon Sep 17 00:00:00 2001 From: Tomasz Maciejczyk <46870145+dramdrung@users.noreply.github.com> Date: Tue, 23 Jun 2020 11:25:02 +0200 Subject: [PATCH 2/2] Fixed test case in HotfixBranchScenarios.cs --- .../IntegrationTests/HotfixBranchScenarios.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs b/src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs index fa7c5995c0..b617971043 100644 --- a/src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs +++ b/src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs @@ -241,8 +241,6 @@ public void IsVersionTakenFromHotfixBranchName() fixture.Repository.CreateBranch("hotfix/4.21.1"); Commands.Checkout(fixture.Repository, "hotfix/4.21.1"); - fixture.Repository.MakeACommit("hotfix test"); - fixture.AssertFullSemver("4.21.1-beta.1+0"); }