Skip to content

Commit 0eed453

Browse files
committed
Run dotnet format
1 parent d935c49 commit 0eed453

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+266
-261
lines changed

LibGit2Sharp.Tests/BlameFixture.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ public void CanBlameFromVariousTypes()
6262
string path = SandboxBareTestRepo();
6363
using (var repo = new Repository(path))
6464
{
65-
AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions {StartingAt = "HEAD" }));
66-
AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions {StartingAt = repo.Head }));
67-
AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions {StartingAt = repo.Head.Tip }));
68-
AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions {StartingAt = repo.Branches["master"]}));
65+
AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions { StartingAt = "HEAD" }));
66+
AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions { StartingAt = repo.Head }));
67+
AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions { StartingAt = repo.Head.Tip }));
68+
AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions { StartingAt = repo.Branches["master"] }));
6969
}
7070
}
7171

@@ -78,7 +78,7 @@ public void CanStopBlame()
7878
// $ git blame .\new.txt
7979
// 9fd738e8 (Scott Chacon 2010-05-24 10:19:19 -0700 1) my new file
8080
// (be3563a comes after 9fd738e8)
81-
var blame = repo.Blame("new.txt", new BlameOptions {StoppingAt = "be3563a"});
81+
var blame = repo.Blame("new.txt", new BlameOptions { StoppingAt = "be3563a" });
8282
Assert.StartsWith("be3563a", blame[0].FinalCommit.Sha);
8383
}
8484
}

LibGit2Sharp.Tests/CheckoutFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public void CanForcefullyCheckoutWithConflictingStagedChanges()
269269
Assert.Throws<CheckoutConflictException>(() => Commands.Checkout(repo, master.CanonicalName));
270270

271271
// Checkout with force option should succeed.
272-
Commands.Checkout(repo, master.CanonicalName, new CheckoutOptions() { CheckoutModifiers = CheckoutModifiers.Force});
272+
Commands.Checkout(repo, master.CanonicalName, new CheckoutOptions() { CheckoutModifiers = CheckoutModifiers.Force });
273273

274274
// Assert that master branch is checked out.
275275
Assert.True(repo.Branches["master"].IsCurrentRepositoryHead);
@@ -411,7 +411,7 @@ public void CheckingOutThroughBranchCallsCheckoutProgress()
411411

412412
Branch branch = repo.Branches[otherBranchName];
413413
Commands.Checkout(repo, branch,
414-
new CheckoutOptions { OnCheckoutProgress = (path, completed, total) => wasCalled = true});
414+
new CheckoutOptions { OnCheckoutProgress = (path, completed, total) => wasCalled = true });
415415

416416
Assert.True(wasCalled);
417417
}
@@ -427,7 +427,7 @@ public void CheckingOutThroughRepositoryCallsCheckoutProgress()
427427
PopulateBasicRepository(repo);
428428
bool wasCalled = false;
429429

430-
Commands.Checkout(repo, otherBranchName, new CheckoutOptions() { OnCheckoutProgress = (path, completed, total) => wasCalled = true});
430+
Commands.Checkout(repo, otherBranchName, new CheckoutOptions() { OnCheckoutProgress = (path, completed, total) => wasCalled = true });
431431

432432
Assert.True(wasCalled);
433433
}
@@ -779,7 +779,7 @@ public void CheckoutFromDetachedHead(string commitPointer)
779779
public void CheckoutBranchFromDetachedHead()
780780
{
781781
string path = SandboxStandardTestRepo();
782-
using (var repo = new Repository(path, new RepositoryOptions{ Identity = Constants.Identity }))
782+
using (var repo = new Repository(path, new RepositoryOptions { Identity = Constants.Identity }))
783783
{
784784
// Set the working directory to the current head
785785
ResetAndCleanWorkingDirectory(repo);

LibGit2Sharp.Tests/ConflictFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private static List<object[]> RenameConflictData
4848

4949
[Theory]
5050
[InlineData(true, "ancestor-and-ours.txt", true, false, FileStatus.DeletedFromIndex, 2)]
51-
[InlineData(false, "ancestor-and-ours.txt", true, true, FileStatus.DeletedFromIndex |FileStatus.NewInWorkdir, 2)]
51+
[InlineData(false, "ancestor-and-ours.txt", true, true, FileStatus.DeletedFromIndex | FileStatus.NewInWorkdir, 2)]
5252
[InlineData(true, "ancestor-and-theirs.txt", true, false, FileStatus.Nonexistent, 2)]
5353
[InlineData(false, "ancestor-and-theirs.txt", true, true, FileStatus.NewInWorkdir, 2)]
5454
[InlineData(true, "ancestor-only.txt", false, false, FileStatus.Nonexistent, 1)]
@@ -101,7 +101,7 @@ public void CanGetOriginalNamesOfRenameConflicts()
101101
Assert.Equal(expected.Count, actual.Count());
102102

103103
int i = 0;
104-
foreach(var name in actual)
104+
foreach (var name in actual)
105105
{
106106
Assert.Equal(expected[i][0], name.Ancestor);
107107
Assert.Equal(expected[i][1], name.Ours);

LibGit2Sharp.Tests/DescribeFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void CanDescribeACommit()
2323

2424
// No lightweight tags can either be used to describe "master"
2525
Assert.Throws<NotFoundException>(() => repo.Describe(masterTip,
26-
new DescribeOptions{ Strategy = DescribeStrategy.Tags }));
26+
new DescribeOptions { Strategy = DescribeStrategy.Tags }));
2727

2828
repo.ApplyTag("myTag", "5b5b025afb0b4c913b4c338a42934a3863bf3644");
2929
Assert.Equal("myTag-5-g4c062a6", repo.Describe(masterTip,
@@ -47,7 +47,7 @@ public void CanDescribeACommit()
4747
var anotherTip = repo.Branches["ForLackOfABetterName"].Tip;
4848
Assert.Equal("test", repo.Describe(anotherTip));
4949
Assert.Equal("test-0-g7b43849", repo.Describe(anotherTip,
50-
new DescribeOptions{ AlwaysRenderLongFormat = true }));
50+
new DescribeOptions { AlwaysRenderLongFormat = true }));
5151
}
5252
}
5353

LibGit2Sharp.Tests/DiffTreeToTreeFixture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ public void DiffThrowsANotFoundExceptionIfATreeIsMissing()
12631263
string repoPath = SandboxBareTestRepo();
12641264

12651265
// Manually delete the tree object to simulate a partial clone
1266-
File.Delete(Path.Combine(repoPath, "objects", "58", "1f9824ecaf824221bd36edf5430f2739a7c4f5"));
1266+
File.Delete(Path.Combine(repoPath, "objects", "58", "1f9824ecaf824221bd36edf5430f2739a7c4f5"));
12671267

12681268
using (var repo = new Repository(repoPath))
12691269
{
@@ -1282,12 +1282,12 @@ public void DiffThrowsANotFoundExceptionIfATreeIsMissing()
12821282

12831283
Assert.Throws<NotFoundException>(() =>
12841284
{
1285-
using (repo.Diff.Compare<TreeChanges>(commit.Tree, otherCommit.Tree)) {}
1285+
using (repo.Diff.Compare<TreeChanges>(commit.Tree, otherCommit.Tree)) { }
12861286
});
12871287

12881288
Assert.Throws<NotFoundException>(() =>
12891289
{
1290-
using (repo.Diff.Compare<TreeChanges>(otherCommit.Tree, commit.Tree)) {}
1290+
using (repo.Diff.Compare<TreeChanges>(otherCommit.Tree, commit.Tree)) { }
12911291
});
12921292
}
12931293
}

LibGit2Sharp.Tests/DiffWorkdirToIndexFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void ComparingReliesOnProvidedConfigEntriesIfAny()
137137
using (var repo = new Repository(path))
138138
{
139139
SetFilemode(repo, true);
140-
using(var changes = repo.Diff.Compare<TreeChanges>(new[] { file }))
140+
using (var changes = repo.Diff.Compare<TreeChanges>(new[] { file }))
141141
{
142142
Assert.Single(changes);
143143

@@ -150,7 +150,7 @@ public void ComparingReliesOnProvidedConfigEntriesIfAny()
150150
using (var repo = new Repository(path))
151151
{
152152
SetFilemode(repo, false);
153-
using(var changes = repo.Diff.Compare<TreeChanges>(new[] { file }))
153+
using (var changes = repo.Diff.Compare<TreeChanges>(new[] { file }))
154154
{
155155
Assert.Empty(changes);
156156
}

LibGit2Sharp.Tests/FileHistoryFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public void CanTellComplexCommitHistory()
163163
var commit4 = MakeAndCommitChange(repo, repoPath, newPath1, "I have done it again!");
164164

165165
// Perform tests.
166-
var commitFilter = new CommitFilter () { SortBy = CommitSortStrategies.Topological };
166+
var commitFilter = new CommitFilter() { SortBy = CommitSortStrategies.Topological };
167167
var fileHistoryEntries = repo.Commits.QueryBy(newPath1, commitFilter).ToList();
168168
var changedBlobs = fileHistoryEntries.Blobs().Distinct().ToList();
169169

LibGit2Sharp.Tests/MergeFixture.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public void CanFastForwardCommit(bool fromDetachedHead, FastForwardStrategy fast
323323
string path = SandboxMergeTestRepo();
324324
using (var repo = new Repository(path))
325325
{
326-
if(fromDetachedHead)
326+
if (fromDetachedHead)
327327
{
328328
Commands.Checkout(repo, repo.Head.Tip.Id.Sha);
329329
}
@@ -512,7 +512,7 @@ public void CanMergeAndNotCommit()
512512
{
513513
Commit commitToMerge = repo.Branches["normal_merge"].Tip;
514514

515-
MergeResult result = repo.Merge(commitToMerge, Constants.Signature, new MergeOptions() { CommitOnSuccess = false});
515+
MergeResult result = repo.Merge(commitToMerge, Constants.Signature, new MergeOptions() { CommitOnSuccess = false });
516516

517517
Assert.Equal(MergeStatus.NonFastForward, result.Status);
518518
Assert.Null(result.Commit);
@@ -649,7 +649,7 @@ public void CanSpecifyConflictFileStrategy(CheckoutFileConflictStrategy conflict
649649

650650
// Get the blob containing the expected content.
651651
Blob expectedBlob = null;
652-
switch(conflictStrategy)
652+
switch (conflictStrategy)
653653
{
654654
case CheckoutFileConflictStrategy.Theirs:
655655
expectedBlob = repo.Lookup<Blob>(conflict.Theirs.Id);
@@ -731,7 +731,7 @@ public void CanMergeBranch(string branchName, FastForwardStrategy strategy, Merg
731731
string path = SandboxMergeTestRepo();
732732
using (var repo = new Repository(path))
733733
{
734-
Branch branch = repo. Branches[branchName];
734+
Branch branch = repo.Branches[branchName];
735735
MergeResult result = repo.Merge(branch, Constants.Signature, new MergeOptions() { FastForwardStrategy = strategy });
736736

737737
Assert.Equal(expectedMergeStatus, result.Status);
@@ -748,7 +748,7 @@ public void CanMergeIntoOrphanedBranch()
748748
repo.Refs.Add("HEAD", "refs/heads/orphan", true);
749749

750750
// Remove entries from the working directory
751-
foreach(var entry in repo.RetrieveStatus())
751+
foreach (var entry in repo.RetrieveStatus())
752752
{
753753
Commands.Unstage(repo, entry.FilePath);
754754
Commands.Remove(repo, entry.FilePath, true);

LibGit2Sharp.Tests/NoteFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void RetrievingNotesFromAGitObjectWhichHasNoNoteYieldsNoResult()
5656
[Fact]
5757
public void CanRetrieveNotesFromAGitObject()
5858
{
59-
var expectedMessages = new [] { "Just Note, don't you understand?\n", "Nope\n", "Not Nope, Note!\n" };
59+
var expectedMessages = new[] { "Just Note, don't you understand?\n", "Nope\n", "Not Nope, Note!\n" };
6060

6161
string path = SandboxBareTestRepo();
6262
using (var repo = new Repository(path))

LibGit2Sharp.Tests/OdbBackendFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private static Commit AddCommitToRepo(IRepository repo)
2626
var commit = repo.Commit("Initial commit", author, author);
2727

2828
relativeFilepath = "big.txt";
29-
var zeros = new string('0', 32*1024 + 3);
29+
var zeros = new string('0', 32 * 1024 + 3);
3030
Touch(repo.Info.WorkingDirectory, relativeFilepath, zeros);
3131
Commands.Stage(repo, relativeFilepath);
3232

@@ -145,7 +145,7 @@ public void CanEnumerateTheContentOfTheObjectDatabase()
145145

146146
AddCommitToRepo(repo);
147147

148-
var expected = new[]{ "1fe3126", "2b297e6", "6518215", "9daeafb" };
148+
var expected = new[] { "1fe3126", "2b297e6", "6518215", "9daeafb" };
149149

150150
IEnumerable<GitObject> objs = repo.ObjectDatabase;
151151

@@ -296,7 +296,7 @@ public override int Read(ObjectId oid, out UnmanagedMemoryStream data, out Objec
296296

297297
if (!m_objectIdToContent.TryGetValue(oid, out gitObject))
298298
{
299-
return (int) ReturnCode.GIT_ENOTFOUND;
299+
return (int)ReturnCode.GIT_ENOTFOUND;
300300
}
301301

302302
data = Allocate(gitObject.Length);
@@ -411,7 +411,7 @@ public override int ExistsPrefix(string shortSha, out ObjectId found)
411411
if (numFound > 1)
412412
{
413413
found = null;
414-
return (int) ReturnCode.GIT_EAMBIGUOUS;
414+
return (int)ReturnCode.GIT_EAMBIGUOUS;
415415
}
416416
}
417417

LibGit2Sharp.Tests/PatchEntryChangesFixture.cs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,37 @@
88

99
namespace LibGit2Sharp.Tests
1010
{
11-
public class PatchEntryChangesFixture : BaseFixture
12-
{
13-
[Fact]
14-
public void PatchEntryBasics()
11+
public class PatchEntryChangesFixture : BaseFixture
1512
{
16-
// Init test repo
17-
var path = SandboxStandardTestRepoGitDir();
18-
string file = "numbers.txt";
13+
[Fact]
14+
public void PatchEntryBasics()
15+
{
16+
// Init test repo
17+
var path = SandboxStandardTestRepoGitDir();
18+
string file = "numbers.txt";
1919

20-
// The repo
21-
using (var repo = new Repository(path))
22-
{
23-
Tree rootCommitTree = repo.Lookup<Commit>("f8d44d7").Tree;
24-
Tree commitTreeWithUpdatedFile = repo.Lookup<Commit>("ec9e401").Tree;
20+
// The repo
21+
using (var repo = new Repository(path))
22+
{
23+
Tree rootCommitTree = repo.Lookup<Commit>("f8d44d7").Tree;
24+
Tree commitTreeWithUpdatedFile = repo.Lookup<Commit>("ec9e401").Tree;
2525

26-
// Create patch by diffing
27-
using (var patch = repo.Diff.Compare<Patch>(rootCommitTree, commitTreeWithUpdatedFile))
28-
{
29-
PatchEntryChanges entryChanges = patch[file];
30-
Assert.Equal(2, entryChanges.LinesAdded);
31-
Assert.Equal(1, entryChanges.LinesDeleted);
32-
Assert.Equal(187, entryChanges.Patch.Length);
33-
// Smoke test
34-
Assert.Equal(Mode.NonExecutableFile, entryChanges.Mode);
35-
Assert.Equal(new ObjectId("4625a3628cb78970c57e23a2fe2574514ba403c7"), entryChanges.Oid);
36-
Assert.Equal(ChangeKind.Modified, entryChanges.Status);
37-
Assert.Equal(file, entryChanges.OldPath);
38-
Assert.Equal(Mode.NonExecutableFile, entryChanges.OldMode);
39-
Assert.Equal(new ObjectId("7909961ae96accd75b6813d32e0fc1d6d52ec941"), entryChanges.OldOid);
26+
// Create patch by diffing
27+
using (var patch = repo.Diff.Compare<Patch>(rootCommitTree, commitTreeWithUpdatedFile))
28+
{
29+
PatchEntryChanges entryChanges = patch[file];
30+
Assert.Equal(2, entryChanges.LinesAdded);
31+
Assert.Equal(1, entryChanges.LinesDeleted);
32+
Assert.Equal(187, entryChanges.Patch.Length);
33+
// Smoke test
34+
Assert.Equal(Mode.NonExecutableFile, entryChanges.Mode);
35+
Assert.Equal(new ObjectId("4625a3628cb78970c57e23a2fe2574514ba403c7"), entryChanges.Oid);
36+
Assert.Equal(ChangeKind.Modified, entryChanges.Status);
37+
Assert.Equal(file, entryChanges.OldPath);
38+
Assert.Equal(Mode.NonExecutableFile, entryChanges.OldMode);
39+
Assert.Equal(new ObjectId("7909961ae96accd75b6813d32e0fc1d6d52ec941"), entryChanges.OldOid);
40+
}
41+
}
4042
}
41-
}
4243
}
43-
}
4444
}

LibGit2Sharp.Tests/RebaseFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void CanRebase(string initialBranchName,
6262

6363
RebaseOptions options = new RebaseOptions()
6464
{
65-
RebaseStepStarting = x =>
65+
RebaseStepStarting = x =>
6666
{
6767
beforeRebaseStepCountCorrect &= beforeStepCallCount == x.StepIndex;
6868
totalStepCountCorrect &= (x.TotalStepCount == stepCount);
@@ -276,7 +276,7 @@ public void VerifyRebaseDetailed(string attributes, string lineEnding, string[]
276276
List<Commit> rebasedCommits = repo.Commits.QueryBy(commitFilter).ToList();
277277

278278
Assert.Equal(3, rebasedCommits.Count);
279-
for(int i = 0; i < 3; i++)
279+
for (int i = 0; i < 3; i++)
280280
{
281281
Assert.Equal(expectedTreeIds[i], rebasedCommits[i].Tree.Id);
282282
Assert.Equal(Constants.Signature.Name, rebasedCommits[i].Author.Name);

LibGit2Sharp.Tests/RefSpecFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void CanReplaceRefSpecs(string[] newFetchRefSpecs, string[] newPushRefSpe
8383

8484
repo.Network.Remotes.Update("origin",
8585
r => r.FetchRefSpecs = newFetchRefSpecs, r => r.PushRefSpecs = newPushRefSpecs);
86-
Assert.Equal(oldRefSpecs, remote.RefSpecs.ToList());
86+
Assert.Equal(oldRefSpecs, remote.RefSpecs.ToList());
8787
}
8888

8989
using (var newRemote = repo.Network.Remotes["origin"])

LibGit2Sharp.Tests/ReferenceFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ public void CanUpdateTargetOfADirectReferenceWithAnAbbreviatedSha()
459459
Reference master = repo.Refs[masterRef];
460460
Assert.NotEqual(sha, master.ResolveToDirectReference().Target.Sha);
461461

462-
Reference updated = repo.Refs.UpdateTarget(masterRef, sha.Substring(0,4));
462+
Reference updated = repo.Refs.UpdateTarget(masterRef, sha.Substring(0, 4));
463463

464464
master = repo.Refs[masterRef];
465465
Assert.Equal(updated, master);
@@ -556,7 +556,7 @@ public void CanUpdateTargetOfADirectReferenceWithARevparseSpec()
556556

557557
const string name = "refs/heads/master";
558558

559-
var master = (DirectReference) repo.Refs[name];
559+
var master = (DirectReference)repo.Refs[name];
560560
var @from = master.Target.Id;
561561

562562
const string logMessage = "update target message";

LibGit2Sharp.Tests/RemoveFixture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class RemoveFixture : BaseFixture
2828
* 'git rm <file>' fails ("error: '<file>' has local modifications").
2929
*/
3030
[InlineData(false, "modified_unstaged_file.txt", false, FileStatus.ModifiedInWorkdir, true, true, FileStatus.NewInWorkdir | FileStatus.DeletedFromIndex)]
31-
[InlineData(true, "modified_unstaged_file.txt", true, FileStatus.ModifiedInWorkdir, true, true, FileStatus.Unaltered)]
31+
[InlineData(true, "modified_unstaged_file.txt", true, FileStatus.ModifiedInWorkdir, true, true, FileStatus.Unaltered)]
3232
/***
3333
* Test case: modified file in wd, the modifications have already been promoted to the index.
3434
* 'git rm --cached <file>' works (removes the file from the index)
@@ -150,7 +150,7 @@ public void RemovingAnUnknownFileWithLaxExplicitPathsValidationDoesntThrow(strin
150150

151151
Commands.Remove(repo, relativePath, i % 2 == 0);
152152
Commands.Remove(repo, relativePath, i % 2 == 0,
153-
new ExplicitPathsOptions {ShouldFailOnUnmatchedPath = false});
153+
new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false });
154154
}
155155
}
156156
}
@@ -169,7 +169,7 @@ public void RemovingAnUnknownFileThrowsIfExplicitPath(string relativePath, FileS
169169
Assert.Equal(status, repo.RetrieveStatus(relativePath));
170170

171171
Assert.Throws<UnmatchedPathException>(
172-
() => Commands.Remove(repo, relativePath, i%2 == 0, new ExplicitPathsOptions()));
172+
() => Commands.Remove(repo, relativePath, i % 2 == 0, new ExplicitPathsOptions()));
173173
}
174174
}
175175
}

0 commit comments

Comments
 (0)