File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
GitVersion.Core.Tests/IntegrationTests
GitVersion.Core/VersionCalculation Expand file tree Collapse file tree 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 @@ -101,6 +101,12 @@ public NextVersion FindVersion()
101
101
{
102
102
// set the commit count on the tagged ver
103
103
taggedSemanticVersion . BuildMetaData . CommitsSinceVersionSource = semver . BuildMetaData ? . CommitsSinceVersionSource ;
104
+
105
+ // set the updated prerelease tag when it doesn't match with prerelease tag defined in branch configuration
106
+ if ( preReleaseTagDoesNotMatchConfiguration )
107
+ {
108
+ taggedSemanticVersion . PreReleaseTag = semver . PreReleaseTag ;
109
+ }
104
110
}
105
111
}
106
112
You can’t perform that action at this time.
0 commit comments