Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,4 +554,27 @@ public void PreventDecrementationOfVersionsOnTheMainBranch()
// ✅ succeeds as expected
fixture.AssertFullSemver("1.0.0", configurationBuilder.Build());
}

/// <summary>
/// "track-merge-target: false" reads tag from other branch #4795
/// (see https://github.com/GitTools/GitVersion/issues/4795)
/// </summary>
[Test]
public void TaggedVersionFromTheMainBranchShouldBeConsideredEvenIfItIsNewer()
{
using var fixture = new EmptyRepositoryFixture("main");

var configurationBuilder = GitFlowConfigurationBuilder.New;

fixture.MakeATaggedCommit("1.1.1");
fixture.BranchTo("develop");
fixture.MakeACommit();
fixture.MergeNoFF("main");
fixture.ApplyTag("9.9.9");
fixture.Checkout("develop");
fixture.MakeACommit();

// ✅ succeeds as expected
fixture.AssertFullSemver("9.10.0-alpha.1", configurationBuilder.Build());
}
}
4 changes: 2 additions & 2 deletions src/GitVersion.Core/Core/TaggedSemanticVersionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ IEnumerable<IEnumerable<CommitSemanticVersion>> GetElements()
{
yield return GetTaggedSemanticVersionsOfMainBranchesInternal(
configuration: configuration,
notOlderThan: notOlderThan,
notOlderThan: null,
label: label,
excludeBranches: branch
);
Expand All @@ -65,7 +65,7 @@ IEnumerable<IEnumerable<CommitSemanticVersion>> GetElements()
{
yield return GetTaggedSemanticVersionsOfReleaseBranchesInternal(
configuration: configuration,
notOlderThan: notOlderThan,
notOlderThan: null,
label: label,
excludeBranches: branch
);
Expand Down
Loading