Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52ea999

Browse files
BUGFIX: Fix order of included files
1 parent 4f77888 commit 52ea999

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ def read(self):
410410
# Read includes and append those that we didn't handle yet
411411
# We expect all paths to be normalized and absolute (and will assure that is the case)
412412
if self._has_includes():
413+
include_paths = []
413414
for _, include_path in self.items('include'):
414415
if include_path.startswith('~'):
415416
include_path = osp.expanduser(include_path)
@@ -424,8 +425,11 @@ def read(self):
424425
if include_path in seen or not os.access(include_path, os.R_OK):
425426
continue
426427
seen.add(include_path)
427-
files_to_read.insert(0, include_path)
428+
include_paths.append(include_path)
428429
num_read_include_files += 1
430+
include_paths.reverse()
431+
for include_path in include_paths:
432+
files_to_read.insert(0, include_path)
429433
# each include path in configuration file
430434
# end handle includes
431435
# END for each file object to read

0 commit comments

Comments
 (0)