Skip to content

Commit

Permalink
Issue: GitTools#495, PR GitTools#496 - cleaning up a few leftovers th…
Browse files Browse the repository at this point in the history
…at resulted from a partial merge of pull request. More specifically TagPrefix is always considered optional.
  • Loading branch information
Chris Leigh committed Jul 15, 2015
1 parent 2379c9d commit 98a2aa1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 23 deletions.
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
{
public 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

0 comments on commit 98a2aa1

Please sign in to comment.