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
7171
7272 fixture . AssertFullSemver ( "1.3.1+2" ) ;
7373 }
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+ }
74101}
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ public NextVersion FindVersion()
9797 {
9898 // set the commit count on the tagged ver
9999 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+ }
100106 }
101107 }
102108
You can’t perform that action at this time.
0 commit comments