Skip to content

Commit 07220a5

Browse files
authored
improved specificity of CONFIG_PATTERN regex
1 parent e838614 commit 07220a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jupyterlab_git/git.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414
# Git configuration options exposed through the REST API
1515
ALLOWED_OPTIONS = ['user.name', 'user.email']
16-
# Regex pattern to capture (key, value) of Git configuration options
17-
CONFIG_PATTERN = re.compile(r"(?:^|\n)(\S+)\=")
16+
# Regex pattern to capture (key, value) of Git configuration options.
17+
# See https://git-scm.com/docs/git-config#_syntax for git var syntax
18+
CONFIG_PATTERN = re.compile(r"(?:^|\n)([\w\-\.]+)\=")
1819

1920

2021
class GitAuthInputWrapper:

0 commit comments

Comments
 (0)