There was an error while loading. Please reload this page.
2 parents f033017 + 1551238 commit 3e59876Copy full SHA for 3e59876
2 files changed
git/config.py
@@ -634,6 +634,8 @@ def read(self) -> None: # type: ignore[override]
634
files_to_read = list(self._file_or_files)
635
# END ensure we have a copy of the paths to handle
636
637
+ files_to_read = [osp.abspath(path) if isinstance(path, (str, os.PathLike)) else path for path in files_to_read]
638
+
639
seen = set(files_to_read)
640
num_read_include_files = 0
641
while files_to_read:
test/test_config.py
@@ -310,6 +310,20 @@ def check_test_value(cr, value):
310
with GitConfigParser(fpa, read_only=True) as cr:
311
check_test_value(cr, tv)
312
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
327
@with_rw_directory
328
def test_multiple_include_paths_with_same_key(self, rw_dir):
329
"""Test that multiple 'path' entries under [include] are all respected.
0 commit comments