This repository was archived by the owner on Feb 3, 2023. It is now read-only.
File tree 2 files changed +22
-21
lines changed
2 files changed +22
-21
lines changed Original file line number Diff line number Diff line change @@ -538,27 +538,6 @@ public void DirectlyAccessingAnUnknownTreeEntryOfTheCommitReturnsNull()
538
538
}
539
539
}
540
540
541
- [ Theory ]
542
- [ InlineData ( null , "x@example.com" ) ]
543
- [ InlineData ( "" , "x@example.com" ) ]
544
- [ InlineData ( "X" , null ) ]
545
- [ InlineData ( "X" , "" ) ]
546
- public void CommitWithInvalidSignatureConfigThrows ( string name , string email )
547
- {
548
- string repoPath = InitNewRepository ( ) ;
549
- string configPath = CreateConfigurationWithDummyUser ( name , email ) ;
550
- var options = new RepositoryOptions { GlobalConfigurationLocation = configPath } ;
551
-
552
- using ( var repo = new Repository ( repoPath , options ) )
553
- {
554
- Assert . Equal ( name , repo . Config . GetValueOrDefault < string > ( "user.name" ) ) ;
555
- Assert . Equal ( email , repo . Config . GetValueOrDefault < string > ( "user.email" ) ) ;
556
-
557
- Assert . Throws < LibGit2SharpException > (
558
- ( ) => repo . Commit ( "Initial egotistic commit" , new CommitOptions { AllowEmptyCommit = true } ) ) ;
559
- }
560
- }
561
-
562
541
[ Fact ]
563
542
public void CanCommitWithSignatureFromConfig ( )
564
543
{
Original file line number Diff line number Diff line change @@ -409,5 +409,27 @@ public void PassingANonExistingLocalConfigurationFileToBuildFromthrowss()
409
409
Assert . Throws < FileNotFoundException > ( ( ) => Configuration . BuildFrom (
410
410
Path . Combine ( Path . GetTempPath ( ) , Path . GetRandomFileName ( ) ) ) ) ;
411
411
}
412
+
413
+ [ Theory ]
414
+ [ InlineData ( null , "x@example.com" ) ]
415
+ [ InlineData ( "" , "x@example.com" ) ]
416
+ [ InlineData ( "X" , null ) ]
417
+ [ InlineData ( "X" , "" ) ]
418
+ public void CannotBuildAProperSignatureFromConfigWhenFullIdentityCannotBeFoundInTheConfig ( string name , string email )
419
+ {
420
+ string repoPath = InitNewRepository ( ) ;
421
+ string configPath = CreateConfigurationWithDummyUser ( name , email ) ;
422
+ var options = new RepositoryOptions { GlobalConfigurationLocation = configPath } ;
423
+
424
+ using ( var repo = new Repository ( repoPath , options ) )
425
+ {
426
+ Assert . Equal ( name , repo . Config . GetValueOrDefault < string > ( "user.name" ) ) ;
427
+ Assert . Equal ( email , repo . Config . GetValueOrDefault < string > ( "user.email" ) ) ;
428
+
429
+ Signature signature = repo . Config . BuildSignature ( DateTimeOffset . Now ) ;
430
+
431
+ Assert . Null ( signature ) ;
432
+ }
433
+ }
412
434
}
413
435
}
You can’t perform that action at this time.
0 commit comments