File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,31 @@ public void CanCloneWithCredentials()
155155 } ) ;
156156
157157
158+ using ( var repo = new Repository ( clonedRepoPath ) )
159+ {
160+ string dir = repo . Info . Path ;
161+ Assert . True ( Path . IsPathRooted ( dir ) ) ;
162+ Assert . True ( Directory . Exists ( dir ) ) ;
163+
164+ Assert . NotNull ( repo . Info . WorkingDirectory ) ;
165+ Assert . Equal ( Path . Combine ( scd . RootedDirectoryPath , ".git" + Path . DirectorySeparatorChar ) , repo . Info . Path ) ;
166+ Assert . False ( repo . Info . IsBare ) ;
167+ }
168+ }
169+
170+ [ Theory ]
171+ [ InlineData ( "https://libgit2@bitbucket.org/libgit2/testgitrepository.git" , "libgit3" , "libgit3" ) ]
172+ public void CanCloneFromBBWithCredentials ( string url , string user , string pass )
173+ {
174+ var scd = BuildSelfCleaningDirectory ( ) ;
175+
176+ string clonedRepoPath = Repository . Clone ( url , scd . DirectoryPath , new CloneOptions ( ) {
177+ CredentialsProvider = ( _url , _user , _cred ) => new UsernamePasswordCredentials {
178+ Username = user ,
179+ Password = pass ,
180+ }
181+ } ) ;
182+
158183 using ( var repo = new Repository ( clonedRepoPath ) )
159184 {
160185 string dir = repo . Info . Path ;
You can’t perform that action at this time.
0 commit comments