@@ -211,5 +211,40 @@ public void CanProvideDifferentConfigurationFilesOnInit()
211
211
Assert . Equal ( "system" , repo . Config . Get < string > ( "woot.this-rocks" , ConfigurationLevel . System ) . Value ) ;
212
212
}
213
213
}
214
+
215
+ [ Fact ]
216
+ public void CanProvideDifferentWorkingDirOnClone ( )
217
+ {
218
+ string url = "https://github.com/libgit2/TestGitRepository" ;
219
+ var scd = BuildSelfCleaningDirectory ( ) ;
220
+ var options = new RepositoryOptions { WorkingDirectoryPath = newWorkdir } ;
221
+
222
+ using ( var repo = Repository . Clone ( url , scd . DirectoryPath , false , true , null , null , options ) )
223
+ {
224
+ Assert . Equal ( Path . GetFullPath ( newWorkdir ) + Path . DirectorySeparatorChar , repo . Info . WorkingDirectory ) ;
225
+ }
226
+ }
227
+
228
+ [ Fact ]
229
+ public void CanProvideDifferentConfigurationFilesOnClone ( )
230
+ {
231
+ string url = "https://github.com/libgit2/TestGitRepository" ;
232
+ var scd = BuildSelfCleaningDirectory ( ) ;
233
+ var configScd = BuildSelfCleaningDirectory ( ) ;
234
+ var options = BuildFakeConfigs ( configScd ) ;
235
+
236
+ using ( var repo = Repository . Clone ( url , scd . DirectoryPath , false , true , null , null , options ) )
237
+ {
238
+ Assert . True ( repo . Config . HasConfig ( ConfigurationLevel . Global ) ) ;
239
+ Assert . Equal ( "global" , repo . Config . Get < string > ( "woot.this-rocks" ) . Value ) ;
240
+ Assert . Equal ( 42 , repo . Config . Get < int > ( "wow.man-I-am-totally-global" ) . Value ) ;
241
+
242
+ Assert . True ( repo . Config . HasConfig ( ConfigurationLevel . Xdg ) ) ;
243
+ Assert . Equal ( "xdg" , repo . Config . Get < string > ( "woot.this-rocks" , ConfigurationLevel . Xdg ) . Value ) ;
244
+
245
+ Assert . True ( repo . Config . HasConfig ( ConfigurationLevel . System ) ) ;
246
+ Assert . Equal ( "system" , repo . Config . Get < string > ( "woot.this-rocks" , ConfigurationLevel . System ) . Value ) ;
247
+ }
248
+ }
214
249
}
215
250
}
0 commit comments