@@ -36,20 +36,20 @@ public void CanClone(string url)
3636 }
3737 }
3838
39- private void AssertLocalClone ( string path )
39+ private void AssertLocalClone ( string url , string path = null , bool isCloningAnEmptyRepository = false )
4040 {
4141 var scd = BuildSelfCleaningDirectory ( ) ;
4242
43- string clonedRepoPath = Repository . Clone ( path , scd . DirectoryPath ) ;
43+ string clonedRepoPath = Repository . Clone ( url , scd . DirectoryPath ) ;
4444
4545 using ( var clonedRepo = new Repository ( clonedRepoPath ) )
46- using ( var originalRepo = new Repository ( BareTestRepoPath ) )
46+ using ( var originalRepo = new Repository ( path ?? url ) )
4747 {
4848 Assert . NotEqual ( originalRepo . Info . Path , clonedRepo . Info . Path ) ;
4949 Assert . Equal ( originalRepo . Head , clonedRepo . Head ) ;
5050
5151 Assert . Equal ( originalRepo . Branches . Count ( ) , clonedRepo . Branches . Count ( b => b . IsRemote ) ) ;
52- Assert . Equal ( 1 , clonedRepo . Branches . Count ( b => ! b . IsRemote ) ) ;
52+ Assert . Equal ( isCloningAnEmptyRepository ? 0 : 1 , clonedRepo . Branches . Count ( b => ! b . IsRemote ) ) ;
5353
5454 Assert . Equal ( originalRepo . Tags . Count ( ) , clonedRepo . Tags . Count ( ) ) ;
5555 Assert . Equal ( 1 , clonedRepo . Network . Remotes . Count ( ) ) ;
@@ -60,7 +60,7 @@ private void AssertLocalClone(string path)
6060 public void CanCloneALocalRepositoryFromALocalUri ( )
6161 {
6262 var uri = new Uri ( BareTestRepoPath ) ;
63- AssertLocalClone ( uri . AbsoluteUri ) ;
63+ AssertLocalClone ( uri . AbsoluteUri , BareTestRepoPath ) ;
6464 }
6565
6666 [ Fact ]
0 commit comments