@@ -50,14 +50,14 @@ public void CanUnsetAnEntryFromTheLocalConfiguration()
50
50
var path = BuildTemporaryCloneOfTestRepo ( StandardTestRepoPath ) ;
51
51
using ( var repo = new Repository ( path . RepositoryPath ) )
52
52
{
53
- Assert . False ( repo . Config . Get < bool > ( "unittests.boolsetting" , false ) ) ;
53
+ Assert . False ( repo . Config . Get < bool > ( "unittests.boolsetting" ) ) ;
54
54
55
55
repo . Config . Set ( "unittests.boolsetting" , true ) ;
56
- Assert . True ( repo . Config . Get < bool > ( "unittests.boolsetting" , false ) ) ;
56
+ Assert . True ( repo . Config . Get < bool > ( "unittests.boolsetting" ) ) ;
57
57
58
58
repo . Config . Unset ( "unittests.boolsetting" ) ;
59
59
60
- Assert . False ( repo . Config . Get < bool > ( "unittests.boolsetting" , false ) ) ;
60
+ Assert . False ( repo . Config . Get < bool > ( "unittests.boolsetting" ) ) ;
61
61
}
62
62
}
63
63
@@ -104,7 +104,7 @@ public void CanGetGlobalStringValue()
104
104
{
105
105
InconclusiveIf ( ( ) => ! repo . Config . HasGlobalConfig , "No Git global configuration available" ) ;
106
106
107
- Assert . NotNull ( repo . Config . Get < string > ( "user.name" , null ) ) ;
107
+ Assert . NotNull ( repo . Config . Get < string > ( "user.name" ) ) ;
108
108
}
109
109
}
110
110
@@ -114,7 +114,7 @@ public void CanGetGlobalStringValueWithoutRepo()
114
114
using ( var config = new Configuration ( ) )
115
115
{
116
116
InconclusiveIf ( ( ) => ! config . HasGlobalConfig , "No Git global configuration available" ) ;
117
- Assert . NotNull ( config . Get < string > ( "user.name" , null ) ) ;
117
+ Assert . NotNull ( config . Get < string > ( "user.name" ) ) ;
118
118
}
119
119
}
120
120
@@ -123,8 +123,7 @@ public void CanReadBooleanValue()
123
123
{
124
124
using ( var repo = new Repository ( StandardTestRepoPath ) )
125
125
{
126
- Assert . True ( repo . Config . Get < bool > ( "core.ignorecase" , false ) ) ;
127
- Assert . True ( repo . Config . Get < bool > ( "core" , "ignorecase" , false ) ) ;
126
+ Assert . True ( repo . Config . Get < bool > ( "core.ignorecase" ) ) ;
128
127
}
129
128
}
130
129
@@ -133,8 +132,7 @@ public void CanReadIntValue()
133
132
{
134
133
using ( var repo = new Repository ( StandardTestRepoPath ) )
135
134
{
136
- Assert . Equal ( 2 , repo . Config . Get < int > ( "unittests.intsetting" , 42 ) ) ;
137
- Assert . Equal ( 2 , repo . Config . Get < int > ( "unittests" , "intsetting" , 42 ) ) ;
135
+ Assert . Equal ( 2 , repo . Config . Get < int > ( "unittests.intsetting" ) ) ;
138
136
}
139
137
}
140
138
@@ -143,8 +141,7 @@ public void CanReadLongValue()
143
141
{
144
142
using ( var repo = new Repository ( StandardTestRepoPath ) )
145
143
{
146
- Assert . Equal ( 15234 , repo . Config . Get < long > ( "unittests.longsetting" , 42 ) ) ;
147
- Assert . Equal ( 15234 , repo . Config . Get < long > ( "unittests" , "longsetting" , 42 ) ) ;
144
+ Assert . Equal ( 15234 , repo . Config . Get < long > ( "unittests.longsetting" ) ) ;
148
145
}
149
146
}
150
147
@@ -153,8 +150,8 @@ public void CanReadStringValue()
153
150
{
154
151
using ( var repo = new Repository ( StandardTestRepoPath ) )
155
152
{
156
- Assert . Equal ( "+refs/heads/*:refs/remotes/origin/*" , repo . Config . Get < string > ( "remote.origin.fetch" , null ) ) ;
157
- Assert . Equal ( "+refs/heads/*:refs/remotes/origin/*" , repo . Config . Get < string > ( "remote" , "origin" , "fetch" , null ) ) ;
153
+ Assert . Equal ( "+refs/heads/*:refs/remotes/origin/*" , repo . Config . Get < string > ( "remote.origin.fetch" ) ) ;
154
+ Assert . Equal ( "+refs/heads/*:refs/remotes/origin/*" , repo . Config . Get < string > ( "remote" , "origin" , "fetch" ) ) ;
158
155
}
159
156
}
160
157
@@ -200,7 +197,7 @@ public void CanSetGlobalStringValue()
200
197
{
201
198
InconclusiveIf ( ( ) => ! repo . Config . HasGlobalConfig , "No Git global configuration available" ) ;
202
199
203
- var existing = repo . Config . Get < string > ( "user.name" , null ) ;
200
+ var existing = repo . Config . Get < string > ( "user.name" ) ;
204
201
Assert . NotNull ( existing ) ;
205
202
206
203
try
@@ -223,7 +220,7 @@ public void CanSetGlobalStringValueWithoutRepo()
223
220
{
224
221
InconclusiveIf ( ( ) => ! config . HasGlobalConfig , "No Git global configuration available" ) ;
225
222
226
- var existing = config . Get < string > ( "user.name" , null ) ;
223
+ var existing = config . Get < string > ( "user.name" ) ;
227
224
Assert . NotNull ( existing ) ;
228
225
229
226
try
@@ -311,8 +308,8 @@ public void ReadingUnsupportedTypeThrows()
311
308
{
312
309
using ( var repo = new Repository ( StandardTestRepoPath ) )
313
310
{
314
- Assert . Throws < ArgumentException > ( ( ) => repo . Config . Get < short > ( "unittests.setting" , 42 ) ) ;
315
- Assert . Throws < ArgumentException > ( ( ) => repo . Config . Get < Configuration > ( "unittests.setting" , null ) ) ;
311
+ Assert . Throws < ArgumentException > ( ( ) => repo . Config . Get < short > ( "unittests.setting" ) ) ;
312
+ Assert . Throws < ArgumentException > ( ( ) => repo . Config . Get < Configuration > ( "unittests.setting" ) ) ;
316
313
}
317
314
}
318
315
@@ -321,10 +318,10 @@ public void ReadingValueThatDoesntExistReturnsDefault()
321
318
{
322
319
using ( var repo = new Repository ( StandardTestRepoPath ) )
323
320
{
324
- Assert . Null ( repo . Config . Get < string > ( "unittests.ghostsetting" , null ) ) ;
325
- Assert . Equal ( 0 , repo . Config . Get < int > ( "unittests.ghostsetting" , 0 ) ) ;
326
- Assert . Equal ( 0L , repo . Config . Get < long > ( "unittests.ghostsetting" , 0L ) ) ;
327
- Assert . False ( repo . Config . Get < bool > ( "unittests.ghostsetting" , false ) ) ;
321
+ Assert . Null ( repo . Config . Get < string > ( "unittests.ghostsetting" ) ) ;
322
+ Assert . Equal ( 0 , repo . Config . Get < int > ( "unittests.ghostsetting" ) ) ;
323
+ Assert . Equal ( 0L , repo . Config . Get < long > ( "unittests.ghostsetting" ) ) ;
324
+ Assert . False ( repo . Config . Get < bool > ( "unittests.ghostsetting" ) ) ;
328
325
Assert . Equal ( "42" , repo . Config . Get ( "unittests.ghostsetting" , "42" ) ) ;
329
326
Assert . Equal ( 42 , repo . Config . Get ( "unittests.ghostsetting" , 42 ) ) ;
330
327
Assert . Equal ( 42L , repo . Config . Get ( "unittests.ghostsetting" , 42L ) ) ;
0 commit comments