Skip to content

Commit 13ccb8f

Browse files
committed
code cleanup
1 parent cb017de commit 13ccb8f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/GitVersion.App.Tests/HelpWriterTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public void AllArgsAreInHelp()
5353

5454
private static bool IsNotInHelp(IReadOnlyDictionary<string, string> lookup, string propertyName, string helpText)
5555
{
56-
if (lookup.ContainsKey(propertyName))
57-
return !helpText.Contains(lookup[propertyName]);
56+
if (lookup.TryGetValue(propertyName, out var value))
57+
return !helpText.Contains(value);
5858

5959
return !helpText.Contains("/" + propertyName.ToLower());
6060
}

src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitFlow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public void FeatureFromDevelopBranchWithMainline(bool withPullRequestIntoDevelop
242242
var configuration = GitFlowConfigurationBuilder.New
243243
.WithNextVersion("1.2.0")
244244
.WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline)
245-
.WithBranch("feature", _ => _.WithIncrement(IncrementStrategy.Minor))
245+
.WithBranch("feature", builder => builder.WithIncrement(IncrementStrategy.Minor))
246246
.Build();
247247

248248
using var fixture = new EmptyRepositoryFixture();

src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ private IReadOnlyCollection<ICommit> GetCommitHistory(string? tagPrefix, Semanti
116116
var targetShas = new Lazy<HashSet<string>>(() =>
117117
taggedSemanticVersionRepository
118118
.GetTaggedSemanticVersions(tagPrefix, semanticVersionFormat, ignore)
119-
.SelectMany(_ => _)
120-
.Where(_ => _.Value.IsMatchForBranchSpecificLabel(label))
121-
.Select(_ => _.Tag.TargetSha)
119+
.SelectMany(versionWithTags => versionWithTags)
120+
.Where(versionWithTag => versionWithTag.Value.IsMatchForBranchSpecificLabel(label))
121+
.Select(versionWithTag => versionWithTag.Tag.TargetSha)
122122
.ToHashSet()
123123
);
124124

0 commit comments

Comments
 (0)