File tree 2 files changed +33
-0
lines changed
GitVersion.Core/VersionCalculation
GitVersion.Core.Tests/IntegrationTests
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -71,4 +71,31 @@ public void WhenSupportIsBranchedAndTaggedFromAnotherSupportEnsureNewMinorIsUsed
71
71
72
72
fixture . AssertFullSemver ( "1.3.1+2" ) ;
73
73
}
74
+
75
+ [ Test ]
76
+ public void WhenSupportIsBranchedFromMainWithSpecificTag ( )
77
+ {
78
+ using var fixture = new EmptyRepositoryFixture ( ) ;
79
+ fixture . Repository . MakeACommit ( ) ;
80
+ fixture . AssertFullSemver ( "0.1.0+0" ) ;
81
+
82
+ fixture . Repository . ApplyTag ( "1.4.0-rc" ) ;
83
+ fixture . Repository . MakeACommit ( ) ;
84
+ fixture . Repository . CreateBranch ( "support/1" ) ;
85
+ Commands . Checkout ( fixture . Repository , "support/1" ) ;
86
+ fixture . AssertFullSemver ( "1.4.0+1" ) ;
87
+ }
88
+
89
+ [ Test ]
90
+ public void WhenSupportIsBranchedFromMainWithSpecificTagOnCommit ( )
91
+ {
92
+ using var fixture = new EmptyRepositoryFixture ( ) ;
93
+ fixture . Repository . MakeACommit ( ) ;
94
+ fixture . AssertFullSemver ( "0.1.0+0" ) ;
95
+
96
+ fixture . Repository . ApplyTag ( "1.4.0-rc" ) ;
97
+ fixture . Repository . CreateBranch ( "support/1" ) ;
98
+ Commands . Checkout ( fixture . Repository , "support/1" ) ;
99
+ fixture . AssertFullSemver ( "1.4.0" ) ;
100
+ }
74
101
}
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ public NextVersion FindVersion()
97
97
{
98
98
// set the commit count on the tagged ver
99
99
taggedSemanticVersion . BuildMetaData . CommitsSinceVersionSource = semver . BuildMetaData ? . CommitsSinceVersionSource ;
100
+
101
+ // set the updated prerelease tag when it doesn't match with prerelease tag defined in branch configuration
102
+ if ( preReleaseTagDoesNotMatchConfiguration )
103
+ {
104
+ taggedSemanticVersion . PreReleaseTag = semver . PreReleaseTag ;
105
+ }
100
106
}
101
107
}
102
108
You can’t perform that action at this time.
0 commit comments