Skip to content

Commit c16f584

Browse files
committed
Add Regex to match content of "includeIf" section
1 parent 8f9840b commit c16f584

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎git/config.py

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
# represents the configuration level of a configuration file
3939
CONFIG_LEVELS = ("system", "user", "global", "repository")
4040

41+
# Section pattern to detect conditional includes.
42+
# https://git-scm.com/docs/git-config#_conditional_includes
43+
CONDITIONAL_INCLUDE_REGEXP = re.compile(r"(?<=includeIf )\"(gitdir|gitdir/i|onbranch):(.+)\"")
4144

4245
class MetaParserBuilder(abc.ABCMeta):
4346

0 commit comments

Comments
 (0)