Skip to content

Commit ae1e843

Browse files
committed
Merge pull request #749 from JakeGinnivan/ClearTag
Added docs and test to confirm "" in branch config will override default
2 parents 40026ac + 6ea382e commit ae1e843

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

docs/configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ The options in here are:
6666
- **`mode:`** Same as above
6767

6868
- **`tag:`** The pre release tag to use for this branch. Use the value `use-branch-name-as-tag` to use the branch name instead.
69-
For example `feature/foo` would become a pre-release tag of `foo` with this value
69+
For example `feature/foo` would become a pre-release tag of `foo` with this value
70+
**Note:** To clear a default use an empty string: `tag: ""`
7071

7172
- **`increment:`** the part of the SemVer to increment when GitVersion detects it needs to be (i.e commit after a tag)
7273

src/GitVersionCore.Tests/ConfigProviderTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@ public void OverwritesDefaultsWithProvidedConfig()
8888
config.Branches["dev(elop)?(ment)?$"].Tag.ShouldBe("dev");
8989
}
9090

91+
[Test]
92+
public void CanRemoveTag()
93+
{
94+
const string text = @"
95+
next-version: 2.0.0
96+
branches:
97+
releases?[/-]:
98+
tag: """"";
99+
SetupConfigFileContent(text);
100+
var config = ConfigurationProvider.Provide(repoPath, fileSystem);
101+
102+
config.NextVersion.ShouldBe("2.0.0");
103+
config.Branches["releases?[/-]"].Tag.ShouldBe(string.Empty);
104+
}
105+
91106
[Test]
92107
public void CanProvideConfigForNewBranch()
93108
{

0 commit comments

Comments
 (0)