Skip to content

Commit 03a0f59

Browse files
committed
Add two tests to verify that the fix works for similar scenarios
1 parent 8a3c7eb commit 03a0f59

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/GitVersionCore.Tests/IntegrationTests/ReleaseBranchScenarios.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,4 +379,35 @@ public void ReleaseBranchShouldUseBranchNameVersionDespiteBumpInPreviousCommit()
379379
fixture.AssertFullSemver("2.0.0-beta.1+2");
380380
}
381381
}
382+
383+
[Test]
384+
public void ReleaseBranchWithACommitShouldUseBranchNameVersionDespiteBumpInPreviousCommit()
385+
{
386+
using (var fixture = new EmptyRepositoryFixture())
387+
{
388+
fixture.Repository.MakeATaggedCommit("1.0");
389+
fixture.Repository.MakeACommit("+semver:major");
390+
fixture.Repository.MakeACommit();
391+
392+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("release/2.0"));
393+
394+
fixture.Repository.MakeACommit();
395+
396+
fixture.AssertFullSemver("2.0.0-beta.1+3");
397+
}
398+
}
399+
400+
[Test]
401+
public void ReleaseBranchedAtCommitWithSemverMessageShouldUseBranchNameVersion()
402+
{
403+
using (var fixture = new EmptyRepositoryFixture())
404+
{
405+
fixture.Repository.MakeATaggedCommit("1.0");
406+
fixture.Repository.MakeACommit("+semver:major");
407+
408+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("release/2.0"));
409+
410+
fixture.AssertFullSemver("2.0.0-beta.1+1");
411+
}
412+
}
382413
}

0 commit comments

Comments
 (0)