Skip to content

Commit 532a859

Browse files
committed
rebase and fix the existing unit tests
1 parent f3b688e commit 532a859

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

docs/input/docs/configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ Sets the format which will be used to format the `CommitDate` output variable.
213213

214214
The header for ignore configuration.
215215

216+
### update-build-number
217+
218+
Configures GitVersion to update the build number or not when running on a build server.
219+
216220
#### sha
217221

218222
A sequence of SHAs to be excluded from the version calculations. Useful when

src/GitVersionCore.Tests/Configuration/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,4 @@ ignore:
123123
sha: []
124124
commit-date-format: yyyy-MM-dd
125125
merge-message-formats: {}
126+
update-build-number: false

src/GitVersionCore/Model/Configuration/Config.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,15 @@ private static T MergeObjects<T>(T target, T source)
118118
[YamlMember(Alias = "merge-message-formats")]
119119
public Dictionary<string, string> MergeMessageFormats { get; set; } = new Dictionary<string, string>();
120120

121-
[YamlMember(Alias = "update-build-number ")]
121+
[YamlMember(Alias = "update-build-number")]
122122
public bool? UpdateBuildNumber { get; set; }
123123

124124
public override string ToString()
125125
{
126126
var stringBuilder = new StringBuilder();
127-
using (var stream = new StringWriter(stringBuilder))
128-
{
129-
ConfigSerializer.Write(this, stream);
130-
stream.Flush();
131-
}
127+
using var stream = new StringWriter(stringBuilder);
128+
ConfigSerializer.Write(this, stream);
129+
stream.Flush();
132130
return stringBuilder.ToString();
133131
}
134132

0 commit comments

Comments
 (0)