@@ -37,7 +37,7 @@ public GitProvider(VBProject project, IRepository repository, ICodePaneWrapperFa
37
37
}
38
38
catch ( RepositoryNotFoundException ex )
39
39
{
40
- throw new SourceControlException ( "Repository not found." , ex ) ;
40
+ throw new SourceControlException ( SourceControlText . GitRepoNotFound , ex ) ;
41
41
}
42
42
}
43
43
@@ -114,7 +114,7 @@ public override IRepository Clone(string remotePathOrUrl, string workingDirector
114
114
}
115
115
catch ( LibGit2SharpException ex )
116
116
{
117
- throw new SourceControlException ( "Failed to clone remote repository." , ex ) ;
117
+ throw new SourceControlException ( SourceControlText . GitRepoNotCloned , ex ) ;
118
118
}
119
119
}
120
120
@@ -130,7 +130,7 @@ public override IRepository Init(string directory, bool bare = false)
130
130
}
131
131
catch ( LibGit2SharpException ex )
132
132
{
133
- throw new SourceControlException ( "Unable to initialize repository." , ex ) ;
133
+ throw new SourceControlException ( SourceControlText . GitNotInit , ex ) ;
134
134
}
135
135
}
136
136
@@ -162,7 +162,7 @@ public override IRepository InitVBAProject(string directory)
162
162
}
163
163
catch ( LibGit2SharpException ex )
164
164
{
165
- throw new SourceControlException ( "Unable to perform intial commit." , ex ) ;
165
+ throw new SourceControlException ( SourceControlText . GitNoInitialCommit , ex ) ;
166
166
}
167
167
}
168
168
@@ -190,7 +190,7 @@ public override void Push()
190
190
}
191
191
catch ( LibGit2SharpException ex )
192
192
{
193
- throw new SourceControlException ( "Push Failed." , ex ) ;
193
+ throw new SourceControlException ( SourceControlText . GitPushFailed , ex ) ;
194
194
}
195
195
}
196
196
@@ -218,7 +218,7 @@ public override void Fetch([Optional] string remoteName)
218
218
}
219
219
catch ( LibGit2SharpException ex )
220
220
{
221
- throw new SourceControlException ( "Fetch failed." , ex ) ;
221
+ throw new SourceControlException ( SourceControlText . GitFetchFailed , ex ) ;
222
222
}
223
223
}
224
224
@@ -243,7 +243,7 @@ public override void Pull()
243
243
}
244
244
catch ( LibGit2SharpException ex )
245
245
{
246
- throw new SourceControlException ( "Pull Failed." , ex ) ;
246
+ throw new SourceControlException ( SourceControlText . GitPullFailed , ex ) ;
247
247
}
248
248
}
249
249
@@ -258,7 +258,7 @@ public override void Commit(string message)
258
258
}
259
259
catch ( LibGit2SharpException ex )
260
260
{
261
- throw new SourceControlException ( "Commit Failed." , ex ) ;
261
+ throw new SourceControlException ( SourceControlText . GitCommitFailed , ex ) ;
262
262
}
263
263
}
264
264
@@ -270,7 +270,7 @@ public override void Stage(string filePath)
270
270
}
271
271
catch ( LibGit2SharpException ex )
272
272
{
273
- throw new SourceControlException ( "Failed to stage file." , ex ) ;
273
+ throw new SourceControlException ( SourceControlText . GitFileStageFailed , ex ) ;
274
274
}
275
275
}
276
276
@@ -282,7 +282,7 @@ public override void Stage(IEnumerable<string> filePaths)
282
282
}
283
283
catch ( LibGit2SharpException ex )
284
284
{
285
- throw new SourceControlException ( "Failed to stage file." , ex ) ;
285
+ throw new SourceControlException ( SourceControlText . GitFileStageFailed , ex ) ;
286
286
}
287
287
}
288
288
@@ -320,7 +320,7 @@ public override void Checkout(string branch)
320
320
}
321
321
catch ( LibGit2SharpException ex )
322
322
{
323
- throw new SourceControlException ( "Checkout failed." , ex ) ;
323
+ throw new SourceControlException ( SourceControlText . GitCheckoutFailed , ex ) ;
324
324
}
325
325
}
326
326
@@ -335,7 +335,7 @@ public override void CreateBranch(string branch)
335
335
}
336
336
catch ( LibGit2SharpException ex )
337
337
{
338
- throw new SourceControlException ( "Branch creation failed." , ex ) ;
338
+ throw new SourceControlException ( SourceControlText . GitNewBranchFailed , ex ) ;
339
339
}
340
340
}
341
341
@@ -350,7 +350,7 @@ public override void CreateBranch(string sourceBranch, string branch)
350
350
}
351
351
catch ( LibGit2SharpException ex )
352
352
{
353
- throw new SourceControlException ( "Branch creation failed." , ex ) ;
353
+ throw new SourceControlException ( SourceControlText . GitNewBranchFailed , ex ) ;
354
354
}
355
355
}
356
356
@@ -374,7 +374,7 @@ public override void Publish(string branch)
374
374
}
375
375
catch ( LibGit2SharpException ex )
376
376
{
377
- throw new SourceControlException ( "Publish failed." , ex ) ;
377
+ throw new SourceControlException ( SourceControlText . GitPublishFailed , ex ) ;
378
378
}
379
379
}
380
380
@@ -400,7 +400,7 @@ public override void Unpublish(string branch)
400
400
}
401
401
catch ( LibGit2SharpException ex )
402
402
{
403
- throw new SourceControlException ( "Unpublish failed." , ex ) ;
403
+ throw new SourceControlException ( SourceControlText . GitUnpublishFailed , ex ) ;
404
404
}
405
405
}
406
406
@@ -412,14 +412,14 @@ public override void Revert()
412
412
413
413
if ( results . Status == RevertStatus . Conflicts )
414
414
{
415
- throw new SourceControlException ( "Revert resulted in conflicts. Revert failed." ) ;
415
+ throw new SourceControlException ( SourceControlText . GitRevertConflict ) ;
416
416
}
417
417
418
418
base . Revert ( ) ;
419
419
}
420
420
catch ( LibGit2SharpException ex )
421
421
{
422
- throw new SourceControlException ( "Revert failed." , ex ) ;
422
+ throw new SourceControlException ( SourceControlText . GitRevertFailed , ex ) ;
423
423
}
424
424
}
425
425
@@ -432,7 +432,7 @@ public override void AddFile(string filePath)
432
432
}
433
433
catch ( LibGit2SharpException ex )
434
434
{
435
- throw new SourceControlException ( string . Format ( "Failed to stage file {0}" , filePath ) , ex ) ;
435
+ throw new SourceControlException ( string . Format ( SourceControlText . GitFileStageFailedMsg , filePath ) , ex ) ;
436
436
}
437
437
}
438
438
@@ -448,7 +448,7 @@ public override void RemoveFile(string filePath)
448
448
}
449
449
catch ( LibGit2SharpException ex )
450
450
{
451
- throw new SourceControlException ( string . Format ( "Failed to remove file {0} from staging area." , filePath ) , ex ) ;
451
+ throw new SourceControlException ( string . Format ( SourceControlText . GitFileStageFailedMsg , filePath ) , ex ) ;
452
452
}
453
453
}
454
454
@@ -461,7 +461,7 @@ public override IEnumerable<IFileStatusEntry> Status()
461
461
}
462
462
catch ( LibGit2SharpException ex )
463
463
{
464
- throw new SourceControlException ( "Failed to retrieve repository status." , ex ) ;
464
+ throw new SourceControlException ( SourceControlText . GitRepoStatusFailed , ex ) ;
465
465
}
466
466
}
467
467
@@ -476,7 +476,7 @@ public override void Undo(string filePath)
476
476
}
477
477
catch ( LibGit2SharpException ex )
478
478
{
479
- throw new SourceControlException ( "Undo failed." , ex ) ;
479
+ throw new SourceControlException ( SourceControlText . GitUndoFailed , ex ) ;
480
480
}
481
481
}
482
482
@@ -507,7 +507,7 @@ public override void DeleteBranch(string branchName)
507
507
}
508
508
catch ( LibGit2SharpException ex )
509
509
{
510
- throw new SourceControlException ( "Branch deletion failed." , ex ) ;
510
+ throw new SourceControlException ( SourceControlText . GitBranchDeleteFailed , ex ) ;
511
511
}
512
512
}
513
513
0 commit comments