Skip to content

Commit 16601f0

Browse files
committed
code formatting
1 parent 342d05e commit 16601f0

File tree

7 files changed

+31
-36
lines changed

7 files changed

+31
-36
lines changed

src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -146,27 +146,25 @@ private static async Task VerifyPullRequestVersionIsCalculatedProperly(string pu
146146
using var fixture = new EmptyRepositoryFixture();
147147
var remoteRepositoryPath = FileSystemHelper.Path.GetRepositoryTempPath();
148148
RepositoryFixtureBase.Init(remoteRepositoryPath);
149-
using (var remoteRepository = new Repository(remoteRepositoryPath))
150-
{
151-
remoteRepository.Config.Set("user.name", "Test");
152-
remoteRepository.Config.Set("user.email", "[email protected]");
153-
fixture.Repository.Network.Remotes.Add("origin", remoteRepositoryPath);
154-
Console.WriteLine("Created git repository at {0}", remoteRepositoryPath);
155-
remoteRepository.MakeATaggedCommit("1.0.3");
156-
157-
var branch = remoteRepository.CreateBranch("FeatureBranch");
158-
Commands.Checkout(remoteRepository, branch);
159-
remoteRepository.MakeCommits(2);
160-
Commands.Checkout(remoteRepository, remoteRepository.Head.Tip.Sha);
161-
//Emulate merge commit
162-
var mergeCommitSha = remoteRepository.MakeACommit().Sha;
163-
Commands.Checkout(remoteRepository, TestBase.MainBranch); // HEAD cannot be pointing at the merge commit
164-
remoteRepository.Refs.Add(pullRequestRef, new ObjectId(mergeCommitSha));
165-
166-
// Checkout PR commit
167-
Commands.Fetch(fixture.Repository, "origin", [], new FetchOptions(), null);
168-
Commands.Checkout(fixture.Repository, mergeCommitSha);
169-
}
149+
using var remoteRepository = new Repository(remoteRepositoryPath);
150+
remoteRepository.Config.Set("user.name", "Test");
151+
remoteRepository.Config.Set("user.email", "[email protected]");
152+
fixture.Repository.Network.Remotes.Add("origin", remoteRepositoryPath);
153+
Console.WriteLine("Created git repository at {0}", remoteRepositoryPath);
154+
remoteRepository.MakeATaggedCommit("1.0.3");
155+
156+
var branch = remoteRepository.CreateBranch("FeatureBranch");
157+
Commands.Checkout(remoteRepository, branch);
158+
remoteRepository.MakeCommits(2);
159+
Commands.Checkout(remoteRepository, remoteRepository.Head.Tip.Sha);
160+
//Emulate merge commit
161+
var mergeCommitSha = remoteRepository.MakeACommit().Sha;
162+
Commands.Checkout(remoteRepository, TestBase.MainBranch); // HEAD cannot be pointing at the merge commit
163+
remoteRepository.Refs.Add(pullRequestRef, new ObjectId(mergeCommitSha));
164+
165+
// Checkout PR commit
166+
Commands.Fetch(fixture.Repository, "origin", [], new FetchOptions(), null);
167+
Commands.Checkout(fixture.Repository, mergeCommitSha);
170168

171169
var programFixture = new ProgramFixture(fixture.RepositoryPath);
172170
programFixture.WithOverrides(services =>
@@ -199,12 +197,12 @@ private static async Task VerifyPullRequestVersionIsCalculatedProperly(string pu
199197
public void VerifyPullRequestInput(string pullRequestRef, string friendly, bool isBranch, bool isPullRequest, bool isRemote)
200198
{
201199
var refName = new ReferenceName(pullRequestRef);
202-
Assert.Multiple(() =>
200+
using (Assert.EnterMultipleScope())
203201
{
204202
Assert.That(refName.Friendly, Is.EqualTo(friendly));
205203
Assert.That(refName.IsLocalBranch, Is.EqualTo(isBranch));
206204
Assert.That(refName.IsPullRequest, Is.EqualTo(isPullRequest));
207205
Assert.That(refName.IsRemoteBranch, Is.EqualTo(isRemote));
208-
});
206+
}
209207
}
210208
}

src/GitVersion.Core/Helpers/FileSystemHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ public static string GetTempPath()
8888

8989
public static string GetDirectoryName(string? path)
9090
{
91-
ArgumentNullException.ThrowIfNull(path, nameof(path));
91+
ArgumentNullException.ThrowIfNull(path);
9292

9393
return fileSystem.Path.GetDirectoryName(path)!;
9494
}
9595

9696
public static string GetFileName(string? path)
9797
{
98-
ArgumentNullException.ThrowIfNull(path, nameof(path));
98+
ArgumentNullException.ThrowIfNull(path);
9999

100100
return fileSystem.Path.GetFileName(path);
101101
}
@@ -116,7 +116,7 @@ public static string Combine(string? path1, string? path2)
116116

117117
public static string Combine(string? path1)
118118
{
119-
ArgumentNullException.ThrowIfNull(path1, nameof(path1));
119+
ArgumentNullException.ThrowIfNull(path1);
120120

121121
return fileSystem.Path.Combine(path1);
122122
}

src/GitVersion.LibGit2Sharp/Git/BranchCollection.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ internal BranchCollection(LibGit2Sharp.BranchCollection collection, Diff diff, G
1818
this.repo = repo.NotNull();
1919
}
2020

21-
public IEnumerator<IBranch> GetEnumerator()
22-
=> this.branches.Value.GetEnumerator();
21+
public IEnumerator<IBranch> GetEnumerator() => this.branches.Value.GetEnumerator();
2322

2423
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
2524

src/GitVersion.LibGit2Sharp/Git/CommitCollection.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ internal CommitCollection(ICommitLog collection, Diff diff, GitRepository repo)
1818
this.repo = repo.NotNull();
1919
}
2020

21-
public IEnumerator<ICommit> GetEnumerator()
22-
=> this.commits.Value.GetEnumerator();
21+
public IEnumerator<ICommit> GetEnumerator() => this.commits.Value.GetEnumerator();
2322

2423
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
2524

src/GitVersion.LibGit2Sharp/Git/ReferenceCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public IEnumerator<IReference> GetEnumerator()
1515
return this.references.GetEnumerator();
1616
}
1717

18+
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
19+
1820
public void Add(string name, string canonicalRefNameOrObject, bool allowOverwrite = false) => this.innerCollection.Add(name, canonicalRefNameOrObject, allowOverwrite);
1921

2022
public void UpdateTarget(IReference directRef, IObjectId targetId)
@@ -23,8 +25,6 @@ public void UpdateTarget(IReference directRef, IObjectId targetId)
2325
this.references = null;
2426
}
2527

26-
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
27-
2828
public IReference? this[string name]
2929
{
3030
get

src/GitVersion.LibGit2Sharp/Git/TagCollection.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ internal TagCollection(LibGit2Sharp.TagCollection collection, LibGit2Sharp.Diff
1414
this.tags = new Lazy<IReadOnlyCollection<ITag>>(() => [.. collection.Select(tag => repo.GetOrCreate(tag, diff))]);
1515
}
1616

17-
public IEnumerator<ITag> GetEnumerator()
18-
=> this.tags.Value.GetEnumerator();
17+
public IEnumerator<ITag> GetEnumerator() => this.tags.Value.GetEnumerator();
1918

2019
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
2120
}

src/GitVersion.Output/TemplateManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class TemplateManager(TemplateType templateType)
1616

1717
public string? GetTemplateFor(string? fileExtension)
1818
{
19-
ArgumentNullException.ThrowIfNull(fileExtension, nameof(fileExtension));
19+
ArgumentNullException.ThrowIfNull(fileExtension);
2020

2121
string? result = null;
2222

@@ -30,7 +30,7 @@ internal class TemplateManager(TemplateType templateType)
3030

3131
public string? GetAddFormatFor(string? fileExtension)
3232
{
33-
ArgumentNullException.ThrowIfNull(fileExtension, nameof(fileExtension));
33+
ArgumentNullException.ThrowIfNull(fileExtension);
3434

3535
string? result = null;
3636

0 commit comments

Comments
 (0)