Skip to content

Commit 15b0b64

Browse files
committed
cleanup
1 parent f2ec37e commit 15b0b64

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/GitVersion.BuildAgents/Agents/GitHubActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public override void WriteIntegration(Action<string?> writer, GitVersionVariable
2525

2626
// https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files
2727
// The outgoing environment variables must be written to a temporary file (identified by the $GITHUB_ENV environment
28-
// variable, which changes for every step in a workflow) which is then parsed. That file must also be UTF-8 or it will fail.
28+
// variable, which changes for every step in a workflow) which is then parsed. That file must also be UTF-8, or it will fail.
2929
var gitHubSetEnvFilePath = this.Environment.GetEnvironmentVariable(GitHubSetEnvTempFileEnvironmentVariableName);
3030

3131
if (gitHubSetEnvFilePath != null)

src/GitVersion.BuildAgents/Agents/MyGet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public override string[] GenerateSetParameterMessage(string name, string? value)
2929
messages.Add($"##myget[buildNumber '{ServiceMessageEscapeHelper.EscapeValue(value)}']");
3030
}
3131

32-
return messages.ToArray();
32+
return [.. messages];
3333
}
3434

3535
public override string? GenerateSetVersionMessage(GitVersionVariables variables) => null;

src/GitVersion.Core/Core/BranchesContainingCommitFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal class BranchesContainingCommitFinder(IGitRepository repository, ILog lo
1212
public IEnumerable<IBranch> GetBranchesContainingCommit(ICommit commit, IEnumerable<IBranch>? branches = null, bool onlyTrackedBranches = false)
1313
{
1414
commit.NotNull();
15-
branches ??= this.repository.Branches.ToList();
15+
branches ??= [.. this.repository.Branches];
1616

1717
// TODO Should we cache this?
1818
// Yielding part is split from the main part of the method to avoid having the exception check performed lazily.

src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected static MsBuildTaskFixtureResult<T> ExecuteMsBuildTaskInAzurePipeline<T
4848
task.SolutionDirectory = fixture.LocalRepositoryFixture.RepositoryPath;
4949
AddOverrides(task);
5050
var msbuildFixture = new MsBuildTaskFixture(fixture);
51-
var environmentVariables = new List<KeyValuePair<string, string?>>(env.ToArray());
51+
var environmentVariables = env.ToList();
5252
if (buildNumber != null)
5353
{
5454
environmentVariables.Add(new("BUILD_BUILDNUMBER", buildNumber));
@@ -78,6 +78,7 @@ protected static MsBuildTaskFixtureResult<T> ExecuteMsBuildTaskInGitHubActions<T
7878
var result = msbuildFixture.Execute(task);
7979
if (!result.Success)
8080
Console.WriteLine(result.Log);
81+
8182
return result;
8283
}
8384

0 commit comments

Comments
 (0)