@@ -156,7 +156,7 @@ public void CheckoutAddsMissingFilesInWorkingDirectory()
156
156
// Remove the file in master branch
157
157
// Verify it exists after checking out otherBranch.
158
158
string fileFullPath = Path . Combine ( repo . Info . WorkingDirectory , originalFilePath ) ;
159
- repo . Remove ( fileFullPath ) ;
159
+ Commands . Remove ( repo , fileFullPath ) ;
160
160
repo . Commit ( "2nd commit" , Constants . Signature , Constants . Signature ) ;
161
161
162
162
// Checkout other_branch
@@ -184,7 +184,7 @@ public void CheckoutRemovesExtraFilesInWorkingDirectory()
184
184
string newFileFullPath = Touch (
185
185
repo . Info . WorkingDirectory , "b.txt" , "hello from master branch!\n " ) ;
186
186
187
- repo . Stage ( newFileFullPath ) ;
187
+ Commands . Stage ( repo , newFileFullPath ) ;
188
188
repo . Commit ( "2nd commit" , Constants . Signature , Constants . Signature ) ;
189
189
190
190
// Checkout other_branch
@@ -212,7 +212,7 @@ public void CheckoutUpdatesModifiedFilesInWorkingDirectory()
212
212
string fullPath = Touch (
213
213
repo . Info . WorkingDirectory , originalFilePath , "Update : hello from master branch!\n " ) ;
214
214
215
- repo . Stage ( fullPath ) ;
215
+ Commands . Stage ( repo , fullPath ) ;
216
216
repo . Commit ( "2nd commit" , Constants . Signature , Constants . Signature ) ;
217
217
218
218
// Checkout other_branch
@@ -254,15 +254,15 @@ public void CanForcefullyCheckoutWithConflictingStagedChanges()
254
254
// Add change to master.
255
255
Touch ( repo . Info . WorkingDirectory , originalFilePath , originalFileContent ) ;
256
256
257
- repo . Stage ( originalFilePath ) ;
257
+ Commands . Stage ( repo , originalFilePath ) ;
258
258
repo . Commit ( "change in master" , Constants . Signature , Constants . Signature ) ;
259
259
260
260
// Checkout otherBranch.
261
261
repo . Checkout ( otherBranchName ) ;
262
262
263
263
// Add change to otherBranch.
264
264
Touch ( repo . Info . WorkingDirectory , originalFilePath , alternateFileContent ) ;
265
- repo . Stage ( originalFilePath ) ;
265
+ Commands . Stage ( repo , originalFilePath ) ;
266
266
267
267
// Assert that normal checkout throws exception
268
268
// for the conflict.
@@ -287,15 +287,15 @@ public void CheckingOutWithMergeConflictsThrows()
287
287
using ( var repo = new Repository ( repoPath ) )
288
288
{
289
289
Touch ( repo . Info . WorkingDirectory , originalFilePath , "Hello\n " ) ;
290
- repo . Stage ( originalFilePath ) ;
290
+ Commands . Stage ( repo , originalFilePath ) ;
291
291
repo . Commit ( "Initial commit" , Constants . Signature , Constants . Signature ) ;
292
292
293
293
// Create 2nd branch
294
294
repo . CreateBranch ( "branch2" ) ;
295
295
296
296
// Update file in main
297
297
Touch ( repo . Info . WorkingDirectory , originalFilePath , "Hello from master!\n " ) ;
298
- repo . Stage ( originalFilePath ) ;
298
+ Commands . Stage ( repo , originalFilePath ) ;
299
299
repo . Commit ( "2nd commit" , Constants . Signature , Constants . Signature ) ;
300
300
301
301
// Checkout branch2
@@ -307,7 +307,7 @@ public void CheckingOutWithMergeConflictsThrows()
307
307
Assert . Throws < CheckoutConflictException > ( ( ) => repo . Checkout ( "master" ) ) ;
308
308
309
309
// And when there are staged commits
310
- repo . Stage ( originalFilePath ) ;
310
+ Commands . Stage ( repo , originalFilePath ) ;
311
311
Assert . Throws < CheckoutConflictException > ( ( ) => repo . Checkout ( "master" ) ) ;
312
312
}
313
313
}
@@ -322,15 +322,15 @@ public void CanCancelCheckoutThroughNotifyCallback()
322
322
const string relativePath = "a.txt" ;
323
323
Touch ( repo . Info . WorkingDirectory , relativePath , "Hello\n " ) ;
324
324
325
- repo . Stage ( relativePath ) ;
325
+ Commands . Stage ( repo , relativePath ) ;
326
326
repo . Commit ( "Initial commit" , Constants . Signature , Constants . Signature ) ;
327
327
328
328
// Create 2nd branch
329
329
repo . CreateBranch ( "branch2" ) ;
330
330
331
331
// Update file in main
332
332
Touch ( repo . Info . WorkingDirectory , relativePath , "Hello from master!\n " ) ;
333
- repo . Stage ( relativePath ) ;
333
+ Commands . Stage ( repo , relativePath ) ;
334
334
repo . Commit ( "2nd commit" , Constants . Signature , Constants . Signature ) ;
335
335
336
336
// Checkout branch2
@@ -453,23 +453,23 @@ public void CheckingOutCallsCheckoutNotify(CheckoutNotifyFlags notifyFlags, stri
453
453
454
454
const string relativePathUpdated = "updated.txt" ;
455
455
Touch ( repo . Info . WorkingDirectory , relativePathUpdated , "updated file text A" ) ;
456
- repo . Stage ( relativePathUpdated ) ;
456
+ Commands . Stage ( repo , relativePathUpdated ) ;
457
457
repo . Commit ( "Commit initial update file" , Constants . Signature , Constants . Signature ) ;
458
458
459
459
// Create conflicting change
460
460
const string relativePathConflict = "conflict.txt" ;
461
461
Touch ( repo . Info . WorkingDirectory , relativePathConflict , "conflict file text A" ) ;
462
- repo . Stage ( relativePathConflict ) ;
462
+ Commands . Stage ( repo , relativePathConflict ) ;
463
463
repo . Commit ( "Initial commit of conflict.txt and update.txt" , Constants . Signature , Constants . Signature ) ;
464
464
465
465
// Create another branch
466
466
repo . CreateBranch ( "newbranch" ) ;
467
467
468
468
// Make an edit to conflict.txt and update.txt
469
469
Touch ( repo . Info . WorkingDirectory , relativePathUpdated , "updated file text BB" ) ;
470
- repo . Stage ( relativePathUpdated ) ;
470
+ Commands . Stage ( repo , relativePathUpdated ) ;
471
471
Touch ( repo . Info . WorkingDirectory , relativePathConflict , "conflict file text BB" ) ;
472
- repo . Stage ( relativePathConflict ) ;
472
+ Commands . Stage ( repo , relativePathConflict ) ;
473
473
474
474
repo . Commit ( "2nd commit of conflict.txt and update.txt on master branch" , Constants . Signature , Constants . Signature ) ;
475
475
@@ -478,14 +478,14 @@ public void CheckingOutCallsCheckoutNotify(CheckoutNotifyFlags notifyFlags, stri
478
478
479
479
// Make alternate edits to conflict.txt and update.txt
480
480
Touch ( repo . Info . WorkingDirectory , relativePathUpdated , "updated file text CCC" ) ;
481
- repo . Stage ( relativePathUpdated ) ;
481
+ Commands . Stage ( repo , relativePathUpdated ) ;
482
482
Touch ( repo . Info . WorkingDirectory , relativePathConflict , "conflict file text CCC" ) ;
483
- repo . Stage ( relativePathConflict ) ;
483
+ Commands . Stage ( repo , relativePathConflict ) ;
484
484
repo . Commit ( "2nd commit of conflict.txt and update.txt on newbranch" , Constants . Signature , Constants . Signature ) ;
485
485
486
486
// make conflicting change to conflict.txt
487
487
Touch ( repo . Info . WorkingDirectory , relativePathConflict , "conflict file text DDDD" ) ;
488
- repo . Stage ( relativePathConflict ) ;
488
+ Commands . Stage ( repo , relativePathConflict ) ;
489
489
490
490
// Create ignored change
491
491
string relativePathIgnore = Path . Combine ( "bin" , "ignored.txt" ) ;
@@ -596,7 +596,7 @@ public void CheckoutRetainsStagedChanges()
596
596
597
597
// Generate a staged change.
598
598
string fullPathFileA = Touch ( repo . Info . WorkingDirectory , originalFilePath , alternateFileContent ) ;
599
- repo . Stage ( fullPathFileA ) ;
599
+ Commands . Stage ( repo , fullPathFileA ) ;
600
600
601
601
// Verify that there is a staged entry.
602
602
Assert . Equal ( 1 , repo . RetrieveStatus ( ) . Staged . Count ( ) ) ;
@@ -680,7 +680,7 @@ public void CheckoutBranchSnapshot()
680
680
681
681
// Add commit to master
682
682
string fullPath = Touch ( repo . Info . WorkingDirectory , originalFilePath , "Update : hello from master branch!\n " ) ;
683
- repo . Stage ( fullPath ) ;
683
+ Commands . Stage ( repo , fullPath ) ;
684
684
repo . Commit ( "2nd commit" , Constants . Signature , Constants . Signature ) ;
685
685
686
686
Assert . False ( repo . Info . IsHeadDetached ) ;
@@ -1038,10 +1038,10 @@ private void PopulateBasicRepository(IRepository repo)
1038
1038
{
1039
1039
// Generate a .gitignore file.
1040
1040
string gitIgnoreFilePath = Touch ( repo . Info . WorkingDirectory , ".gitignore" , "bin" ) ;
1041
- repo . Stage ( gitIgnoreFilePath ) ;
1041
+ Commands . Stage ( repo , gitIgnoreFilePath ) ;
1042
1042
1043
1043
string fullPathFileA = Touch ( repo . Info . WorkingDirectory , originalFilePath , originalFileContent ) ;
1044
- repo . Stage ( fullPathFileA ) ;
1044
+ Commands . Stage ( repo , fullPathFileA ) ;
1045
1045
1046
1046
repo . Commit ( "Initial commit" , Constants . Signature , Constants . Signature ) ;
1047
1047
0 commit comments