@@ -50,14 +50,14 @@ public void CanUnsetAnEntryFromTheLocalConfiguration()
5050 var path = BuildTemporaryCloneOfTestRepo ( StandardTestRepoPath ) ;
5151 using ( var repo = new Repository ( path . RepositoryPath ) )
5252 {
53- Assert . False ( repo . Config . Get < bool > ( "unittests.boolsetting" , false ) ) ;
53+ Assert . False ( repo . Config . Get < bool > ( "unittests.boolsetting" ) ) ;
5454
5555 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" ) ) ;
5757
5858 repo . Config . Unset ( "unittests.boolsetting" ) ;
5959
60- Assert . False ( repo . Config . Get < bool > ( "unittests.boolsetting" , false ) ) ;
60+ Assert . False ( repo . Config . Get < bool > ( "unittests.boolsetting" ) ) ;
6161 }
6262 }
6363
@@ -104,7 +104,7 @@ public void CanGetGlobalStringValue()
104104 {
105105 InconclusiveIf ( ( ) => ! repo . Config . HasGlobalConfig , "No Git global configuration available" ) ;
106106
107- Assert . NotNull ( repo . Config . Get < string > ( "user.name" , null ) ) ;
107+ Assert . NotNull ( repo . Config . Get < string > ( "user.name" ) ) ;
108108 }
109109 }
110110
@@ -114,7 +114,7 @@ public void CanGetGlobalStringValueWithoutRepo()
114114 using ( var config = new Configuration ( ) )
115115 {
116116 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" ) ) ;
118118 }
119119 }
120120
@@ -123,8 +123,7 @@ public void CanReadBooleanValue()
123123 {
124124 using ( var repo = new Repository ( StandardTestRepoPath ) )
125125 {
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" ) ) ;
128127 }
129128 }
130129
@@ -133,8 +132,7 @@ public void CanReadIntValue()
133132 {
134133 using ( var repo = new Repository ( StandardTestRepoPath ) )
135134 {
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" ) ) ;
138136 }
139137 }
140138
@@ -143,8 +141,7 @@ public void CanReadLongValue()
143141 {
144142 using ( var repo = new Repository ( StandardTestRepoPath ) )
145143 {
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" ) ) ;
148145 }
149146 }
150147
@@ -153,8 +150,8 @@ public void CanReadStringValue()
153150 {
154151 using ( var repo = new Repository ( StandardTestRepoPath ) )
155152 {
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" ) ) ;
158155 }
159156 }
160157
@@ -200,7 +197,7 @@ public void CanSetGlobalStringValue()
200197 {
201198 InconclusiveIf ( ( ) => ! repo . Config . HasGlobalConfig , "No Git global configuration available" ) ;
202199
203- var existing = repo . Config . Get < string > ( "user.name" , null ) ;
200+ var existing = repo . Config . Get < string > ( "user.name" ) ;
204201 Assert . NotNull ( existing ) ;
205202
206203 try
@@ -223,7 +220,7 @@ public void CanSetGlobalStringValueWithoutRepo()
223220 {
224221 InconclusiveIf ( ( ) => ! config . HasGlobalConfig , "No Git global configuration available" ) ;
225222
226- var existing = config . Get < string > ( "user.name" , null ) ;
223+ var existing = config . Get < string > ( "user.name" ) ;
227224 Assert . NotNull ( existing ) ;
228225
229226 try
@@ -311,8 +308,8 @@ public void ReadingUnsupportedTypeThrows()
311308 {
312309 using ( var repo = new Repository ( StandardTestRepoPath ) )
313310 {
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" ) ) ;
316313 }
317314 }
318315
@@ -321,10 +318,10 @@ public void ReadingValueThatDoesntExistReturnsDefault()
321318 {
322319 using ( var repo = new Repository ( StandardTestRepoPath ) )
323320 {
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" ) ) ;
328325 Assert . Equal ( "42" , repo . Config . Get ( "unittests.ghostsetting" , "42" ) ) ;
329326 Assert . Equal ( 42 , repo . Config . Get ( "unittests.ghostsetting" , 42 ) ) ;
330327 Assert . Equal ( 42L , repo . Config . Get ( "unittests.ghostsetting" , 42L ) ) ;
0 commit comments