diff options
author | nulltoken <emeric.fermas@gmail.com> | 2015-01-27 10:11:19 +0300 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2015-02-01 13:29:05 +0300 |
commit | 19cd9f5c5ae4f65c5d22e9ed0dddd8898ff19c01 (patch) | |
tree | 815abd3f391910b8fcabc16fae30a8b651d52ce8 /LibGit2Sharp.Tests | |
parent | 03e2bb28d89b1f9280b4637cfc63a73b1eed434a (diff) |
Deprecate Branch.Checkout()
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r-- | LibGit2Sharp.Tests/CheckoutFixture.cs | 11 | ||||
-rw-r--r-- | LibGit2Sharp.Tests/CherryPickFixture.cs | 4 | ||||
-rw-r--r-- | LibGit2Sharp.Tests/MergeFixture.cs | 20 |
3 files changed, 18 insertions, 17 deletions
diff --git a/LibGit2Sharp.Tests/CheckoutFixture.cs b/LibGit2Sharp.Tests/CheckoutFixture.cs index 03fa3917..d50ff8d1 100644 --- a/LibGit2Sharp.Tests/CheckoutFixture.cs +++ b/LibGit2Sharp.Tests/CheckoutFixture.cs @@ -162,7 +162,7 @@ namespace LibGit2Sharp.Tests // Checkout other_branch Branch otherBranch = repo.Branches[otherBranchName]; Assert.NotNull(otherBranch); - otherBranch.Checkout(); + repo.Checkout(otherBranch); // Verify working directory is updated Assert.False(repo.RetrieveStatus().IsDirty); @@ -190,7 +190,7 @@ namespace LibGit2Sharp.Tests // Checkout other_branch Branch otherBranch = repo.Branches[otherBranchName]; Assert.NotNull(otherBranch); - otherBranch.Checkout(); + repo.Checkout(otherBranch); // Verify working directory is updated Assert.False(repo.RetrieveStatus().IsDirty); @@ -218,7 +218,7 @@ namespace LibGit2Sharp.Tests // Checkout other_branch Branch otherBranch = repo.Branches[otherBranchName]; Assert.NotNull(otherBranch); - otherBranch.Checkout(); + repo.Checkout(otherBranch); // Verify working directory is updated Assert.False(repo.RetrieveStatus().IsDirty); @@ -410,7 +410,8 @@ namespace LibGit2Sharp.Tests bool wasCalled = false; Branch branch = repo.Branches[otherBranchName]; - branch.Checkout(new CheckoutOptions() { OnCheckoutProgress = (path, completed, total) => wasCalled = true}); + repo.Checkout(branch, + new CheckoutOptions { OnCheckoutProgress = (path, completed, total) => wasCalled = true}); Assert.True(wasCalled); } @@ -684,7 +685,7 @@ namespace LibGit2Sharp.Tests Assert.False(repo.Info.IsHeadDetached); - initial.Checkout(); + repo.Checkout(initial); // Head should point at initial commit. Assert.Equal(repo.Head.Tip, initialCommit); diff --git a/LibGit2Sharp.Tests/CherryPickFixture.cs b/LibGit2Sharp.Tests/CherryPickFixture.cs index be08684c..c4b61455 100644 --- a/LibGit2Sharp.Tests/CherryPickFixture.cs +++ b/LibGit2Sharp.Tests/CherryPickFixture.cs @@ -46,7 +46,7 @@ namespace LibGit2Sharp.Tests using (var repo = new Repository(path)) { var firstBranch = repo.CreateBranch("FirstBranch"); - firstBranch.Checkout(); + repo.Checkout(firstBranch); // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit). AddFileCommitToRepo(repo, sharedBranchFileName); @@ -56,7 +56,7 @@ namespace LibGit2Sharp.Tests AddFileCommitToRepo(repo, firstBranchFileName); AddFileCommitToRepo(repo, sharedBranchFileName, "The first branches comment"); // Change file in first branch - secondBranch.Checkout(); + repo.Checkout(secondBranch); // Commit with ONE new file to second branch (FirstBranch and SecondBranch now point to separate commits that both have the same parent commit). AddFileCommitToRepo(repo, secondBranchFileName); AddFileCommitToRepo(repo, sharedBranchFileName, "The second branches comment"); // Change file in second branch diff --git a/LibGit2Sharp.Tests/MergeFixture.cs b/LibGit2Sharp.Tests/MergeFixture.cs index 13178e24..af386bd6 100644 --- a/LibGit2Sharp.Tests/MergeFixture.cs +++ b/LibGit2Sharp.Tests/MergeFixture.cs @@ -94,7 +94,7 @@ namespace LibGit2Sharp.Tests using (var repo = new Repository(path)) { var firstBranch = repo.CreateBranch("FirstBranch"); - firstBranch.Checkout(); + repo.Checkout(firstBranch); var originalTreeCount = firstBranch.Tip.Tree.Count; // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit). @@ -111,7 +111,7 @@ namespace LibGit2Sharp.Tests } else { - secondBranch.Checkout(); + repo.Checkout(secondBranch); } // Commit with ONE new file to second branch (FirstBranch and SecondBranch now point to separate commits that both have the same parent commit). @@ -143,14 +143,14 @@ namespace LibGit2Sharp.Tests using (var repo = new Repository(path)) { var firstBranch = repo.CreateBranch("FirstBranch"); - firstBranch.Checkout(); + repo.Checkout(firstBranch); // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit). AddFileCommitToRepo(repo, sharedBranchFileName); var secondBranch = repo.CreateBranch("SecondBranch"); - secondBranch.Checkout(); + repo.Checkout(secondBranch); MergeResult mergeResult = repo.Merge(repo.Branches["FirstBranch"].Tip, Constants.Signature); @@ -176,7 +176,7 @@ namespace LibGit2Sharp.Tests repo.RemoveUntrackedFiles(); var firstBranch = repo.CreateBranch("FirstBranch"); - firstBranch.Checkout(); + repo.Checkout(firstBranch); // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit). AddFileCommitToRepo(repo, sharedBranchFileName); @@ -193,7 +193,7 @@ namespace LibGit2Sharp.Tests } else { - secondBranch.Checkout(); + repo.Checkout(secondBranch); } Assert.Equal(shouldMergeOccurInDetachedHeadState, repo.Info.IsHeadDetached); @@ -227,7 +227,7 @@ namespace LibGit2Sharp.Tests using (var repo = new Repository(path)) { var firstBranch = repo.CreateBranch("FirstBranch"); - firstBranch.Checkout(); + repo.Checkout(firstBranch); // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit). AddFileCommitToRepo(repo, sharedBranchFileName); @@ -237,7 +237,7 @@ namespace LibGit2Sharp.Tests AddFileCommitToRepo(repo, firstBranchFileName); AddFileCommitToRepo(repo, sharedBranchFileName, "The first branches comment"); // Change file in first branch - secondBranch.Checkout(); + repo.Checkout(secondBranch); // Commit with ONE new file to second branch (FirstBranch and SecondBranch now point to separate commits that both have the same parent commit). AddFileCommitToRepo(repo, secondBranchFileName); AddFileCommitToRepo(repo, sharedBranchFileName, "The second branches comment"); // Change file in second branch @@ -267,7 +267,7 @@ namespace LibGit2Sharp.Tests using (var repo = new Repository(path)) { var firstBranch = repo.CreateBranch("FirstBranch"); - firstBranch.Checkout(); + repo.Checkout(firstBranch); // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit). AddFileCommitToRepo(repo, sharedBranchFileName); @@ -277,7 +277,7 @@ namespace LibGit2Sharp.Tests AddFileCommitToRepo(repo, firstBranchFileName); AddFileCommitToRepo(repo, sharedBranchFileName, "\0The first branches comment\0"); // Change file in first branch - secondBranch.Checkout(); + repo.Checkout(secondBranch); // Commit with ONE new file to second branch (FirstBranch and SecondBranch now point to separate commits that both have the same parent commit). AddFileCommitToRepo(repo, secondBranchFileName); AddFileCommitToRepo(repo, sharedBranchFileName, "\0The second branches comment\0"); // Change file in second branch |