Skip to content

Commit 98a2aa1

Browse files
author
Chris Leigh
committed
Issue: GitTools#495, PR GitTools#496 - cleaning up a few leftovers that resulted from a partial merge of pull request. More specifically TagPrefix is always considered optional.
1 parent 2379c9d commit 98a2aa1

File tree

5 files changed

+9
-23
lines changed

5 files changed

+9
-23
lines changed

GitVersionCore.Tests/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
assembly-versioning-scheme: MajorMinorPatch
22
mode: ContinuousDelivery
3-
tag-prefix: '[vV]|'
3+
tag-prefix: '[vV]'
44
continuous-delivery-fallback-tag: ci
55
branches:
66
master:

GitVersionCore.Tests/ConfigProviderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public void CanReadDefaultDocument()
120120
config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch);
121121
config.Branches["develop"].Tag.ShouldBe("unstable");
122122
config.Branches["release[/-]"].Tag.ShouldBe("beta");
123-
config.TagPrefix.ShouldBe("[vV]|");
123+
config.TagPrefix.ShouldBe(Config.DefaultTagPrefix);
124124
config.NextVersion.ShouldBe(null);
125125
}
126126

GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -166,25 +166,6 @@ public void CanSpecifyTagPrefixesAsRegex()
166166
}
167167
}
168168

169-
[Test]
170-
public void CanTagPrefixStillBeOptional()
171-
{
172-
using (var fixture = new EmptyRepositoryFixture(new Config { TagPrefix = "[vV]|" })) //we use tag prefix to denote whether optional
173-
{
174-
string TaggedVersion = "v1.0.3";
175-
fixture.Repository.MakeATaggedCommit(TaggedVersion);
176-
fixture.Repository.MakeCommits(5);
177-
178-
fixture.AssertFullSemver("1.0.4+5");
179-
180-
TaggedVersion = "1.0.5";
181-
fixture.Repository.MakeATaggedCommit(TaggedVersion);
182-
fixture.Repository.MakeCommits(1);
183-
184-
fixture.AssertFullSemver("1.0.6+1");
185-
}
186-
}
187-
188169
[Test]
189170
public void AreTagsNotAdheringToTagPrefixIgnored()
190171
{

GitVersionCore.Tests/SemanticVersionTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ public class SemanticVersionTests
2626
[TestCase("1.2.3+4.Branch.Foo", 1, 2, 3, null, null, 4, "Foo", null, null, null, null)]
2727
[TestCase("1.2.3+randomMetaData", 1, 2, 3, null, null, null, null, null, "randomMetaData", null, null)]
2828
[TestCase("1.2.3-beta.1+4.Sha.12234.Othershiz", 1, 2, 3, "beta", 1, 4, null, "12234", "Othershiz", null, null)]
29-
[TestCase("1.2.3", 1, 2, 3, null, null, null, null, null, null, null, "v")]
29+
[TestCase("1.2.3", 1, 2, 3, null, null, null, null, null, null, null, Config.DefaultTagPrefix)]
30+
[TestCase("v1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", Config.DefaultTagPrefix)]
31+
[TestCase("V1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", Config.DefaultTagPrefix)]
32+
[TestCase("version-1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", "version-")]
3033
public void ValidateVersionParsing(
3134
string versionString, int major, int minor, int patch, string tag, int? tagNumber, int? numberOfBuilds,
3235
string branchName, string sha, string otherMetaData, string fullFormattedVersionString, string tagPrefixRegex)

GitVersionCore/Configuration/Config.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
public class Config
88
{
9+
public const string DefaultTagPrefix = "[vV]";
10+
911
Dictionary<string, BranchConfig> branches = new Dictionary<string, BranchConfig>();
1012

1113
public Config()
1214
{
1315
AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch;
14-
TagPrefix = "[vV]|";
16+
TagPrefix = DefaultTagPrefix;
1517
VersioningMode = GitVersion.VersioningMode.ContinuousDelivery;
1618
ContinuousDeploymentFallbackTag = "ci";
1719

0 commit comments

Comments
 (0)