@@ -398,6 +398,10 @@ def test_complex_aliases(self):
398398 self ._to_memcache (fixture_path (".gitconfig" )).getvalue (),
399399 )
400400
401+ def test_config_with_extra_whitespace (self ):
402+ cr = GitConfigParser (fixture_path ("git_config_with_extra_whitespace" ), read_only = True )
403+ self .assertEqual (cr .get ("init" , "defaultBranch" ), "trunk" )
404+
401405 def test_empty_config_value (self ):
402406 cr = GitConfigParser (fixture_path ("git_config_with_empty_value" ), read_only = True )
403407
@@ -413,9 +417,13 @@ def test_config_with_quotes(self):
413417 self .
assertEqual (
cr .
get (
"user" ,
"email" ),
"[email protected] " )
414418
415419 def test_config_with_quotes_with_literal_whitespace (self ):
416- cr = GitConfigParser (fixture_path ("git_config_with_quotes_whitespace " ), read_only = True )
420+ cr = GitConfigParser (fixture_path ("git_config_with_quotes_whitespace_inside " ), read_only = True )
417421 self .assertEqual (cr .get ("core" , "commentString" ), "# " )
418422
423+ def test_config_with_quotes_with_whitespace_outside_value (self ):
424+ cr = GitConfigParser (fixture_path ("git_config_with_quotes_whitespace_outside" ), read_only = True )
425+ self .assertEqual (cr .get ("init" , "defaultBranch" ), "trunk" )
426+
419427 def test_get_values_works_without_requiring_any_other_calls_first (self ):
420428 file_obj = self ._to_memcache (fixture_path ("git_config_multiple" ))
421429 cr = GitConfigParser (file_obj , read_only = True )
0 commit comments