|
1 | 1 | using System;
|
| 2 | +using System.Collections.Generic; |
2 | 3 | using GitVersion;
|
3 | 4 | using LibGit2Sharp;
|
4 | 5 | using NUnit.Framework;
|
@@ -32,6 +33,36 @@ public void ShouldInheritIncrementCorrectlyWithMultiplePossibleParentsAndWeirdly
|
32 | 33 | fixture.AssertFullSemver("1.1.0-JIRA-124.1+2");
|
33 | 34 | }
|
34 | 35 | }
|
| 36 | + |
| 37 | + [Test] |
| 38 | + public void BranchCreatedAfterFastForwardMergeShouldInheritCorrectly() |
| 39 | + { |
| 40 | + var config = new Config(); |
| 41 | + config.Branches.Add("unstable", config.Branches["develop"]); |
| 42 | + |
| 43 | + using (var fixture = new EmptyRepositoryFixture(config)) |
| 44 | + { |
| 45 | + fixture.Repository.MakeATaggedCommit("1.0.0"); |
| 46 | + fixture.Repository.CreateBranch("unstable"); |
| 47 | + fixture.Repository.Checkout("unstable"); |
| 48 | + |
| 49 | + //Create an initial feature branch |
| 50 | + var feature123 = fixture.Repository.CreateBranch("feature/JIRA-123"); |
| 51 | + fixture.Repository.Checkout("feature/JIRA-123"); |
| 52 | + fixture.Repository.MakeCommits(1); |
| 53 | + |
| 54 | + //Merge it |
| 55 | + fixture.Repository.Checkout("unstable"); |
| 56 | + fixture.Repository.Merge(feature123, new Signature("me", "[email protected]", DateTimeOffset.Now)); |
| 57 | + |
| 58 | + //Create a second feature branch |
| 59 | + fixture.Repository.CreateBranch("feature/JIRA-124"); |
| 60 | + fixture.Repository.Checkout("feature/JIRA-124"); |
| 61 | + fixture.Repository.MakeCommits(1); |
| 62 | + |
| 63 | + fixture.AssertFullSemver("1.1.0-JIRA-124.1+2"); |
| 64 | + } |
| 65 | + } |
35 | 66 |
|
36 | 67 | [Test]
|
37 | 68 | public void ShouldNotUseNumberInFeatureBranchAsPreReleaseNumberOffDevelop()
|
|
0 commit comments