File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
GitVersion.Core.Tests/IntegrationTests Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -554,4 +554,27 @@ public void PreventDecrementationOfVersionsOnTheMainBranch()
554554 // ✅ succeeds as expected
555555 fixture . AssertFullSemver ( "1.0.0" , configurationBuilder . Build ( ) ) ;
556556 }
557+
558+ /// <summary>
559+ /// "track-merge-target: false" reads tag from other branch #4795
560+ /// (see https://github.com/GitTools/GitVersion/issues/4795)
561+ /// </summary>
562+ [ Test ]
563+ public void TaggedVersionFromTheMainBranchShouldBeConsideredEvenIfItIsNewer ( )
564+ {
565+ using var fixture = new EmptyRepositoryFixture ( "main" ) ;
566+
567+ var configurationBuilder = GitFlowConfigurationBuilder . New ;
568+
569+ fixture . MakeATaggedCommit ( "1.1.1" ) ;
570+ fixture . BranchTo ( "develop" ) ;
571+ fixture . MakeACommit ( ) ;
572+ fixture . MergeNoFF ( "main" ) ;
573+ fixture . ApplyTag ( "9.9.9" ) ;
574+ fixture . Checkout ( "develop" ) ;
575+ fixture . MakeACommit ( ) ;
576+
577+ // ✅ succeeds as expected
578+ fixture . AssertFullSemver ( "9.10.0-alpha.1" , configurationBuilder . Build ( ) ) ;
579+ }
557580}
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ IEnumerable<IEnumerable<CommitSemanticVersion>> GetElements()
5555 {
5656 yield return GetTaggedSemanticVersionsOfMainBranchesInternal (
5757 configuration : configuration ,
58- notOlderThan : notOlderThan ,
58+ notOlderThan : null ,
5959 label : label ,
6060 excludeBranches : branch
6161 ) ;
@@ -65,7 +65,7 @@ IEnumerable<IEnumerable<CommitSemanticVersion>> GetElements()
6565 {
6666 yield return GetTaggedSemanticVersionsOfReleaseBranchesInternal (
6767 configuration : configuration ,
68- notOlderThan : notOlderThan ,
68+ notOlderThan : null ,
6969 label : label ,
7070 excludeBranches : branch
7171 ) ;
You can’t perform that action at this time.
0 commit comments