@@ -94,7 +94,7 @@ public void CanMergeRepoNonFastForward(bool shouldMergeOccurInDetachedHeadState)
9494 using ( var repo = new Repository ( path ) )
9595 {
9696 var firstBranch = repo . CreateBranch ( "FirstBranch" ) ;
97- firstBranch . Checkout ( ) ;
97+ repo . Checkout ( firstBranch ) ;
9898 var originalTreeCount = firstBranch . Tip . Tree . Count ;
9999
100100 // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit).
@@ -111,7 +111,7 @@ public void CanMergeRepoNonFastForward(bool shouldMergeOccurInDetachedHeadState)
111111 }
112112 else
113113 {
114- secondBranch . Checkout ( ) ;
114+ repo . Checkout ( secondBranch ) ;
115115 }
116116
117117 // 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 @@ public void IsUpToDateMerge()
143143 using ( var repo = new Repository ( path ) )
144144 {
145145 var firstBranch = repo . CreateBranch ( "FirstBranch" ) ;
146- firstBranch . Checkout ( ) ;
146+ repo . Checkout ( firstBranch ) ;
147147
148148 // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit).
149149 AddFileCommitToRepo ( repo , sharedBranchFileName ) ;
150150
151151 var secondBranch = repo . CreateBranch ( "SecondBranch" ) ;
152152
153- secondBranch . Checkout ( ) ;
153+ repo . Checkout ( secondBranch ) ;
154154
155155 MergeResult mergeResult = repo . Merge ( repo . Branches [ "FirstBranch" ] . Tip , Constants . Signature ) ;
156156
@@ -176,7 +176,7 @@ public void CanFastForwardRepos(bool shouldMergeOccurInDetachedHeadState)
176176 repo . RemoveUntrackedFiles ( ) ;
177177
178178 var firstBranch = repo . CreateBranch ( "FirstBranch" ) ;
179- firstBranch . Checkout ( ) ;
179+ repo . Checkout ( firstBranch ) ;
180180
181181 // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit).
182182 AddFileCommitToRepo ( repo , sharedBranchFileName ) ;
@@ -193,7 +193,7 @@ public void CanFastForwardRepos(bool shouldMergeOccurInDetachedHeadState)
193193 }
194194 else
195195 {
196- secondBranch . Checkout ( ) ;
196+ repo . Checkout ( secondBranch ) ;
197197 }
198198
199199 Assert . Equal ( shouldMergeOccurInDetachedHeadState , repo . Info . IsHeadDetached ) ;
@@ -227,7 +227,7 @@ public void ConflictingMergeRepos()
227227 using ( var repo = new Repository ( path ) )
228228 {
229229 var firstBranch = repo . CreateBranch ( "FirstBranch" ) ;
230- firstBranch . Checkout ( ) ;
230+ repo . Checkout ( firstBranch ) ;
231231
232232 // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit).
233233 AddFileCommitToRepo ( repo , sharedBranchFileName ) ;
@@ -237,7 +237,7 @@ public void ConflictingMergeRepos()
237237 AddFileCommitToRepo ( repo , firstBranchFileName ) ;
238238 AddFileCommitToRepo ( repo , sharedBranchFileName , "The first branches comment" ) ; // Change file in first branch
239239
240- secondBranch . Checkout ( ) ;
240+ repo . Checkout ( secondBranch ) ;
241241 // Commit with ONE new file to second branch (FirstBranch and SecondBranch now point to separate commits that both have the same parent commit).
242242 AddFileCommitToRepo ( repo , secondBranchFileName ) ;
243243 AddFileCommitToRepo ( repo , sharedBranchFileName , "The second branches comment" ) ; // Change file in second branch
@@ -267,7 +267,7 @@ public void ConflictingMergeReposBinary()
267267 using ( var repo = new Repository ( path ) )
268268 {
269269 var firstBranch = repo . CreateBranch ( "FirstBranch" ) ;
270- firstBranch . Checkout ( ) ;
270+ repo . Checkout ( firstBranch ) ;
271271
272272 // Commit with ONE new file to both first & second branch (SecondBranch is created on this commit).
273273 AddFileCommitToRepo ( repo , sharedBranchFileName ) ;
@@ -277,7 +277,7 @@ public void ConflictingMergeReposBinary()
277277 AddFileCommitToRepo ( repo , firstBranchFileName ) ;
278278 AddFileCommitToRepo ( repo , sharedBranchFileName , "\0 The first branches comment\0 " ) ; // Change file in first branch
279279
280- secondBranch . Checkout ( ) ;
280+ repo . Checkout ( secondBranch ) ;
281281 // Commit with ONE new file to second branch (FirstBranch and SecondBranch now point to separate commits that both have the same parent commit).
282282 AddFileCommitToRepo ( repo , secondBranchFileName ) ;
283283 AddFileCommitToRepo ( repo , sharedBranchFileName , "\0 The second branches comment\0 " ) ; // Change file in second branch
0 commit comments