Skip to content

TagPrefix cleanup #510

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
merged 3 commits into from
Jul 18, 2015
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDelivery
tag-prefix: '[vV]|'
tag-prefix: '[vV]'
continuous-delivery-fallback-tag: ci
branches:
master:
Expand Down
2 changes: 1 addition & 1 deletion GitVersionCore.Tests/ConfigProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void CanReadDefaultDocument()
config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch);
config.Branches["develop"].Tag.ShouldBe("unstable");
config.Branches["release[/-]"].Tag.ShouldBe("beta");
config.TagPrefix.ShouldBe("[vV]|");
config.TagPrefix.ShouldBe(Config.DefaultTagPrefix);
config.NextVersion.ShouldBe(null);
}

Expand Down
19 changes: 0 additions & 19 deletions GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,25 +166,6 @@ public void CanSpecifyTagPrefixesAsRegex()
}
}

[Test]
public void CanTagPrefixStillBeOptional()
{
using (var fixture = new EmptyRepositoryFixture(new Config { TagPrefix = "[vV]|" })) //we use tag prefix to denote whether optional
{
string TaggedVersion = "v1.0.3";
fixture.Repository.MakeATaggedCommit(TaggedVersion);
fixture.Repository.MakeCommits(5);

fixture.AssertFullSemver("1.0.4+5");

TaggedVersion = "1.0.5";
fixture.Repository.MakeATaggedCommit(TaggedVersion);
fixture.Repository.MakeCommits(1);

fixture.AssertFullSemver("1.0.6+1");
}
}

[Test]
public void AreTagsNotAdheringToTagPrefixIgnored()
{
Expand Down
5 changes: 4 additions & 1 deletion GitVersionCore.Tests/SemanticVersionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ public class SemanticVersionTests
[TestCase("1.2.3+4.Branch.Foo", 1, 2, 3, null, null, 4, "Foo", null, null, null, null)]
[TestCase("1.2.3+randomMetaData", 1, 2, 3, null, null, null, null, null, "randomMetaData", null, null)]
[TestCase("1.2.3-beta.1+4.Sha.12234.Othershiz", 1, 2, 3, "beta", 1, 4, null, "12234", "Othershiz", null, null)]
[TestCase("1.2.3", 1, 2, 3, null, null, null, null, null, null, null, "v")]
[TestCase("1.2.3", 1, 2, 3, null, null, null, null, null, null, null, Config.DefaultTagPrefix)]
[TestCase("v1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", Config.DefaultTagPrefix)]
[TestCase("V1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", Config.DefaultTagPrefix)]
[TestCase("version-1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", "version-")]
public void ValidateVersionParsing(
string versionString, int major, int minor, int patch, string tag, int? tagNumber, int? numberOfBuilds,
string branchName, string sha, string otherMetaData, string fullFormattedVersionString, string tagPrefixRegex)
Expand Down
4 changes: 3 additions & 1 deletion GitVersionCore/Configuration/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

public class Config
{
internal const string DefaultTagPrefix = "[vV]";

Dictionary<string, BranchConfig> branches = new Dictionary<string, BranchConfig>();

public Config()
{
AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch;
TagPrefix = "[vV]|";
TagPrefix = DefaultTagPrefix;
VersioningMode = GitVersion.VersioningMode.ContinuousDelivery;
ContinuousDeploymentFallbackTag = "ci";

Expand Down