@@ -205,6 +205,37 @@ protected virtual void Dispose(bool disposing)
205
205
return ( T ) configurationTypedRetriever [ typeof ( T ) ] ( key , defaultValue , handle ) ;
206
206
}
207
207
208
+ /// <summary>
209
+ /// Get a configuration value for a key. Keys are in the form 'section.name'.
210
+ /// <para>
211
+ /// For example in order to get the value for this in a .git\config file:
212
+ ///
213
+ /// <code>
214
+ /// [core]
215
+ /// bare = true
216
+ /// </code>
217
+ ///
218
+ /// You would call:
219
+ ///
220
+ /// <code>
221
+ /// bool isBare = repo.Config.Get<bool>("core", "bare", false);
222
+ /// </code>
223
+ /// </para>
224
+ /// </summary>
225
+ /// <typeparam name = "T">The configuration value type</typeparam>
226
+ /// <param name = "firstKeyPart">The first key part</param>
227
+ /// <param name = "secondKeyPart">The second key part</param>
228
+ /// <param name = "defaultValue">The default value</param>
229
+ /// <returns>The configuration value, or <c>defaultValue</c> if not set</returns>
230
+ [ Obsolete ]
231
+ public virtual T Get < T > ( string firstKeyPart , string secondKeyPart , T defaultValue )
232
+ {
233
+ Ensure . ArgumentNotNull ( firstKeyPart , "firstKeyPart" ) ;
234
+ Ensure . ArgumentNotNull ( secondKeyPart , "secondKeyPart" ) ;
235
+
236
+ return Get ( new [ ] { firstKeyPart , secondKeyPart } , defaultValue ) ;
237
+ }
238
+
208
239
/// <summary>
209
240
/// Get a configuration value for the given key parts.
210
241
/// <para>
@@ -228,7 +259,7 @@ protected virtual void Dispose(bool disposing)
228
259
/// <param name = "thirdKeyPart">The third key part</param>
229
260
/// <param name = "defaultValue">The default value</param>
230
261
/// <returns>The configuration value, or <c>defaultValue</c> if not set</returns>
231
- public virtual T Get < T > ( string firstKeyPart , string secondKeyPart , string thirdKeyPart , T defaultValue = default ( T ) )
262
+ public virtual T Get < T > ( string firstKeyPart , string secondKeyPart , string thirdKeyPart , T defaultValue )
232
263
{
233
264
Ensure . ArgumentNotNull ( firstKeyPart , "firstKeyPart" ) ;
234
265
Ensure . ArgumentNotNull ( secondKeyPart , "secondKeyPart" ) ;
0 commit comments