@@ -36,20 +36,20 @@ public void CanClone(string url)
36
36
}
37
37
}
38
38
39
- private void AssertLocalClone ( string path )
39
+ private void AssertLocalClone ( string url , string path = null , bool isCloningAnEmptyRepository = false )
40
40
{
41
41
var scd = BuildSelfCleaningDirectory ( ) ;
42
42
43
- string clonedRepoPath = Repository . Clone ( path , scd . DirectoryPath ) ;
43
+ string clonedRepoPath = Repository . Clone ( url , scd . DirectoryPath ) ;
44
44
45
45
using ( var clonedRepo = new Repository ( clonedRepoPath ) )
46
- using ( var originalRepo = new Repository ( BareTestRepoPath ) )
46
+ using ( var originalRepo = new Repository ( path ?? url ) )
47
47
{
48
48
Assert . NotEqual ( originalRepo . Info . Path , clonedRepo . Info . Path ) ;
49
49
Assert . Equal ( originalRepo . Head , clonedRepo . Head ) ;
50
50
51
51
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 ) ) ;
53
53
54
54
Assert . Equal ( originalRepo . Tags . Count ( ) , clonedRepo . Tags . Count ( ) ) ;
55
55
Assert . Equal ( 1 , clonedRepo . Network . Remotes . Count ( ) ) ;
@@ -60,7 +60,7 @@ private void AssertLocalClone(string path)
60
60
public void CanCloneALocalRepositoryFromALocalUri ( )
61
61
{
62
62
var uri = new Uri ( BareTestRepoPath ) ;
63
- AssertLocalClone ( uri . AbsoluteUri ) ;
63
+ AssertLocalClone ( uri . AbsoluteUri , BareTestRepoPath ) ;
64
64
}
65
65
66
66
[ Fact ]
0 commit comments