Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2034 StackOverflow when using increment: Inherit: new unit test #2059

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,50 @@ public void MergingFeatureBranchThatIncrementsMinorNumberIncrementsMinorVersionO
fixture.AssertFullSemver(currentConfig, "1.1.0");
}

[Test]
public void MergingMasterBarnchToDevelopWithInheritIncrementShouldIncrementDevelopPatch()
{
var currentConfig = new Config
{
AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch,
VersioningMode = VersioningMode.Mainline,
Branches = new Dictionary<string, BranchConfig>
{
{
"master", new BranchConfig
{
Increment = IncrementStrategy.Patch
}
},
{
"develop", new BranchConfig
{
Increment = IncrementStrategy.Inherit
}
}
}
};

using var fixture = new EmptyRepositoryFixture();
fixture.MakeACommit("initial in master");
fixture.AssertFullSemver(currentConfig, "0.1.0");
fixture.MakeACommit("master change");
fixture.AssertFullSemver(currentConfig, "0.1.1");

fixture.BranchTo("develop");
fixture.AssertFullSemver(currentConfig, "0.1.2-alpha.0");
fixture.MakeACommit("develop change");
fixture.AssertFullSemver(currentConfig, "0.1.2-alpha.1");

fixture.Checkout("master");
fixture.MakeACommit("master hotfix");
fixture.AssertFullSemver(currentConfig, "0.1.2");

fixture.Checkout("develop");
fixture.MergeNoFF("master");
fixture.AssertFullSemver(currentConfig, "0.1.3-alpha.1");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StackOverflow exception here

}

[Test]
public void VerifyIncrementConfigIsHonoured()
{
Expand Down