File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -634,6 +634,8 @@ def read(self) -> None: # type: ignore[override]
634634 files_to_read = list (self ._file_or_files )
635635 # END ensure we have a copy of the paths to handle
636636
637+ files_to_read = [osp .abspath (path ) if isinstance (path , (str , os .PathLike )) else path for path in files_to_read ]
638+
637639 seen = set (files_to_read )
638640 num_read_include_files = 0
639641 while files_to_read :
Original file line number Diff line number Diff line change @@ -310,6 +310,20 @@ def check_test_value(cr, value):
310310 with GitConfigParser (fpa , read_only = True ) as cr :
311311 check_test_value (cr , tv )
312312
313+ @with_rw_directory
314+ def test_config_relative_path_include (self , rw_dir ):
315+ included_path = osp .join (rw_dir , "included" )
316+ with GitConfigParser (included_path , read_only = False ) as cw :
317+ cw .set_value ("included" , "value" , "included" )
318+
319+ config_path = osp .join (rw_dir , "config" )
320+ with GitConfigParser (config_path , read_only = False ) as cw :
321+ cw .set_value ("include" , "path" , "included" )
322+
323+ relative_config_path = osp .relpath (config_path )
324+ with GitConfigParser (relative_config_path , read_only = True ) as cr :
325+ assert cr .get_value ("included" , "value" ) == "included"
326+
313327 @with_rw_directory
314328 def test_multiple_include_paths_with_same_key (self , rw_dir ):
315329 """Test that multiple 'path' entries under [include] are all respected.
You can’t perform that action at this time.
0 commit comments