@@ -185,15 +185,15 @@ public override IRepository InitVBAProject(string directory)
185
185
var status = repo . RetrieveStatus ( new StatusOptions { DetectRenamesInWorkDir = true } ) ;
186
186
foreach ( var stat in status . Untracked )
187
187
{
188
- repo . Stage ( stat . FilePath ) ;
188
+ LibGit2Sharp . Commands . Stage ( repo , stat . FilePath ) ;
189
189
}
190
190
191
191
try
192
192
{
193
193
//The default behavior of LibGit2Sharp.Repo.Commit is to throw an exception if no signature is found,
194
194
// but BuildSignature() does not throw if a signature is not found, it returns "unknown" instead.
195
195
// so we pass a signature that won't throw along to the commit.
196
- repo . Commit ( "Initial Commit" , GetSignature ( repo ) ) ;
196
+ repo . Commit ( "Initial Commit" , author : GetSignature ( repo ) , committer : GetSignature ( repo ) ) ;
197
197
}
198
198
catch ( LibGit2SharpException ex )
199
199
{
@@ -246,7 +246,9 @@ public override void Fetch([Optional] string remoteName)
246
246
247
247
if ( remote != null )
248
248
{
249
- _repo . Network . Fetch ( remote ) ;
249
+ // FIXME: hardcoded string
250
+ IEnumerable < string > refSpec = new List < string > ( ) { "+refs/heads/*:refs/remotes/origin/*" } ;
251
+ LibGit2Sharp . Commands . Fetch ( _repo , remoteName , refSpec , null , "" ) ;
250
252
}
251
253
252
254
RequeryUnsyncedCommits ( ) ;
@@ -270,7 +272,7 @@ public override void Pull()
270
272
} ;
271
273
272
274
var signature = GetSignature ( ) ;
273
- _repo . Network . Pull ( signature , options ) ;
275
+ LibGit2Sharp . Commands . Pull ( _repo , signature , options ) ;
274
276
275
277
base . Pull ( ) ;
276
278
@@ -289,7 +291,7 @@ public override void Commit(string message)
289
291
//The default behavior of LibGit2Sharp.Repo.Commit is to throw an exception if no signature is found,
290
292
// but BuildSignature() does not throw if a signature is not found, it returns "unknown" instead.
291
293
// so we pass a signature that won't throw along to the commit.
292
- _repo . Commit ( message , GetSignature ( ) ) ;
294
+ _repo . Commit ( message , author : GetSignature ( ) , committer : GetSignature ( ) ) ;
293
295
}
294
296
catch ( LibGit2SharpException ex )
295
297
{
@@ -301,7 +303,7 @@ public override void Stage(string filePath)
301
303
{
302
304
try
303
305
{
304
- _repo . Stage ( filePath ) ;
306
+ LibGit2Sharp . Commands . Stage ( _repo , filePath ) ;
305
307
}
306
308
catch ( LibGit2SharpException ex )
307
309
{
@@ -313,7 +315,7 @@ public override void Stage(IEnumerable<string> filePaths)
313
315
{
314
316
try
315
317
{
316
- _repo . Stage ( filePaths ) ;
318
+ LibGit2Sharp . Commands . Stage ( _repo , filePaths ) ;
317
319
}
318
320
catch ( LibGit2SharpException ex )
319
321
{
@@ -348,7 +350,7 @@ public override void Checkout(string branch)
348
350
{
349
351
try
350
352
{
351
- _repo . Checkout ( _repo . Branches [ branch ] ) ;
353
+ LibGit2Sharp . Commands . Checkout ( _repo , branch ) ;
352
354
base . Checkout ( branch ) ;
353
355
354
356
RequeryUnsyncedCommits ( ) ;
@@ -364,7 +366,7 @@ public override void CreateBranch(string branch)
364
366
try
365
367
{
366
368
_repo . CreateBranch ( branch ) ;
367
- _repo . Checkout ( branch ) ;
369
+ LibGit2Sharp . Commands . Checkout ( _repo , branch ) ;
368
370
369
371
RequeryUnsyncedCommits ( ) ;
370
372
}
@@ -379,7 +381,7 @@ public override void CreateBranch(string sourceBranch, string branch)
379
381
try
380
382
{
381
383
_repo . CreateBranch ( branch , _repo . Branches [ sourceBranch ] . Commits . Last ( ) ) ;
382
- _repo . Checkout ( branch ) ;
384
+ LibGit2Sharp . Commands . Checkout ( _repo , branch ) ;
383
385
384
386
RequeryUnsyncedCommits ( ) ;
385
387
}
@@ -417,7 +419,7 @@ public override void Unpublish(string branch)
417
419
{
418
420
try
419
421
{
420
- var remote = _repo . Branches [ branch ] . Remote ;
422
+ var remote = _repo . Network . Remotes [ branch ] ;
421
423
422
424
_repo . Branches . Update ( _repo . Branches [ branch ] , b => b . Remote = remote . Name ,
423
425
b => b . TrackedBranch = null , b => b . UpstreamBranch = null ) ;
@@ -462,8 +464,7 @@ public override void AddFile(string filePath)
462
464
{
463
465
try
464
466
{
465
- // https://github.com/libgit2/libgit2sharp/wiki/Git-add
466
- _repo . Stage ( filePath ) ;
467
+ LibGit2Sharp . Commands . Stage ( _repo , filePath ) ;
467
468
}
468
469
catch ( LibGit2SharpException ex )
469
470
{
@@ -481,7 +482,7 @@ public override void RemoveFile(string filePath, bool removeFromWorkingDirectory
481
482
try
482
483
{
483
484
NotifyExternalFileChanges = false ;
484
- _repo . Remove ( filePath , removeFromWorkingDirectory ) ;
485
+ LibGit2Sharp . Commands . Remove ( _repo , filePath , removeFromWorkingDirectory ) ;
485
486
NotifyExternalFileChanges = true ;
486
487
}
487
488
catch ( LibGit2SharpException ex )
@@ -554,7 +555,7 @@ public override void DeleteBranch(string branchName)
554
555
} ;
555
556
}
556
557
557
- _repo . Network . Push ( branch . Remote , ":" + _repo . Branches [ branchName ] . UpstreamBranchCanonicalName , options ) ;
558
+ _repo . Network . Push ( _repo . Network . Remotes [ branchName ] , ":" + _repo . Branches [ branchName ] . UpstreamBranchCanonicalName , options ) ;
558
559
}
559
560
560
561
// remote local repo
0 commit comments