Skip to content

Invalid release version after commit beetween merge release to develop #1593

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

Merged
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 @@ -419,6 +419,44 @@ public void CommitOnDevelop_AfterReleaseBranchMergeToDevelop_ShouldNotResetCount
}
}

[Test]
public void CommitBeetweenMergeReleaseToDevelop_ShouldNotResetCount()
{
var config = new Config
{
VersioningMode = VersioningMode.ContinuousDeployment
};

using(var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeACommit("initial");
fixture.Repository.CreateBranch("develop");
Commands.Checkout(fixture.Repository, "develop");
fixture.Repository.CreateBranch("release-2.0.0");
Commands.Checkout(fixture.Repository, "release-2.0.0");
fixture.AssertFullSemver(config, "2.0.0-beta.0");

// Make some commits on release
var commit1 = fixture.Repository.MakeACommit();
var commit2 = fixture.Repository.MakeACommit();
fixture.AssertFullSemver(config, "2.0.0-beta.2");

// Merge release to develop - emulate commit beetween other person release commit push and this commit merge to develop
Commands.Checkout(fixture.Repository, "develop");
fixture.Repository.Merge(commit1, Generate.SignatureNow(), new MergeOptions { FastForwardStrategy = FastForwardStrategy.NoFastForward });
fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow());

// Check version on release after merge to develop
Commands.Checkout(fixture.Repository, "release-2.0.0");
fixture.AssertFullSemver(config, "2.0.0-beta.2");

// Check version on release after making some new commits
fixture.Repository.MakeACommit();
fixture.Repository.MakeACommit();
fixture.AssertFullSemver(config, "2.0.0-beta.4");
}
}

public void ReleaseBranchShouldUseBranchNameVersionDespiteBumpInPreviousCommit()
{
using (var fixture = new EmptyRepositoryFixture())
Expand Down