◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
18 changes: 14 additions & 4 deletions git/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,21 @@ def _included_paths(self) -> List[Tuple[str, str]]:
:return:
The list of paths, where each path is a tuple of (option, value).
"""
paths = []

for section in self.sections():
if section == "include":
paths += self.items(section)

match = CONDITIONAL_INCLUDE_REGEXP.search(section)
if match is None or self._repo is None:
Expand All @@ -579,7 +589,7 @@ def _included_paths(self) -> List[Tuple[str, str]]:
)
if self._repo.git_dir:
if fnmatch.fnmatchcase(os.fspath(self._repo.git_dir), value):
paths += self.items(section)

elif keyword == "onbranch":
try:
Expand All @@ -589,11 +599,11 @@ def _included_paths(self) -> List[Tuple[str, str]]:
continue

if fnmatch.fnmatchcase(branch_name, value):
paths += self.items(section)
elif keyword == "hasconfig:remote.*.url":
for remote in self._repo.remotes:
if fnmatch.fnmatchcase(remote.url, value):
paths += self.items(section)
break
return paths

Expand Down
Loading
Toggle all file notes Toggle all file annotations