@@ -567,10 +567,8 @@ public void CannotCloneWithForbiddenCustomHeaders()
567
567
const string url = "https://github.com/libgit2/TestGitRepository" ;
568
568
569
569
const string knownHeader = "User-Agent: mygit-201" ;
570
- var cloneOptions = new CloneOptions ( )
571
- {
572
- FetchOptions = new FetchOptions { CustomHeaders = new String [ ] { knownHeader } }
573
- } ;
570
+ var cloneOptions = new CloneOptions ( ) ;
571
+ cloneOptions . FetchOptions . CustomHeaders = new string [ ] { knownHeader } ;
574
572
575
573
Assert . Throws < LibGit2SharpException > ( ( ) => Repository . Clone ( url , scd . DirectoryPath , cloneOptions ) ) ;
576
574
}
@@ -583,10 +581,8 @@ public void CannotCloneWithMalformedCustomHeaders()
583
581
const string url = "https://github.com/libgit2/TestGitRepository" ;
584
582
585
583
const string knownHeader = "hello world" ;
586
- var cloneOptions = new CloneOptions ( )
587
- {
588
- FetchOptions = new FetchOptions { CustomHeaders = new String [ ] { knownHeader } }
589
- } ;
584
+ var cloneOptions = new CloneOptions ( ) ;
585
+ cloneOptions . FetchOptions . CustomHeaders = new string [ ] { knownHeader } ;
590
586
591
587
Assert . Throws < LibGit2SharpException > ( ( ) => Repository . Clone ( url , scd . DirectoryPath , cloneOptions ) ) ;
592
588
}
@@ -599,10 +595,8 @@ public void CanCloneWithCustomHeaders()
599
595
const string url = "https://github.com/libgit2/TestGitRepository" ;
600
596
601
597
const string knownHeader = "X-Hello: world" ;
602
- var cloneOptions = new CloneOptions ( )
603
- {
604
- FetchOptions = new FetchOptions { CustomHeaders = new String [ ] { knownHeader } }
605
- } ;
598
+ var cloneOptions = new CloneOptions ( ) ;
599
+ cloneOptions . FetchOptions . CustomHeaders = new string [ ] { knownHeader } ;
606
600
607
601
var clonedRepoPath = Repository . Clone ( url , scd . DirectoryPath , cloneOptions ) ;
608
602
Assert . True ( Directory . Exists ( clonedRepoPath ) ) ;
0 commit comments