We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent85cf7e8 commit313b3b4Copy full SHA for 313b3b4
git/repo/base.py
@@ -77,6 +77,7 @@ class Repo(object):
77
re_whitespace=re.compile(r'\s+')
78
re_hexsha_only=re.compile('^[0-9A-Fa-f]{40}$')
79
re_hexsha_shortened=re.compile('^[0-9A-Fa-f]{4,40}$')
80
+re_envvars=re.compile(r'(\$(\{\s?)?[a-zA-Z_]\w*(\}\s?)?|%\s?[a-zA-Z_]\w*\s?%)')
81
re_author_committer_start=re.compile(r'^(author|committer)')
82
re_tab_full_line=re.compile(r'^\t(.*)$')
83
@@ -125,7 +126,7 @@ def __init__(self, path=None, odbt=GitCmdObjectDB, search_parent_directories=Fal
125
126
epath=epathorpathoros.getcwd()
127
ifnotisinstance(epath,str):
128
epath=str(epath)
-ifexpand_varsand("%"inepathor"$"inepath):
129
+ifexpand_varsandre.search(self.re_envvars,epath):
130
warnings.warn("The use of environment variables in paths is deprecated"+
131
"\nfor security reasons and may be removed in the future!!")
132
epath=expand_path(epath,expand_vars)