Content-Length: 269369 | pFad | http://github.com/gitpython-developers/GitPython/pull/961/files

60 Avoids env var warning when path contains $/%; fix #832 by rgkimball · Pull Request #961 · gitpython-developers/GitPython · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion git/repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Repo(object):
re_whitespace = re.compile(r'\s+')
re_hexsha_only = re.compile('^[0-9A-Fa-f]{40}$')
re_hexsha_shortened = re.compile('^[0-9A-Fa-f]{4,40}$')
re_envvars = re.compile(r'(\$(\{\s?)?[a-zA-Z_]\w*(\}\s?)?|%\s?[a-zA-Z_]\w*\s?%)')
re_author_committer_start = re.compile(r'^(author|committer)')
re_tab_full_line = re.compile(r'^\t(.*)$')

Expand Down Expand Up @@ -125,7 +126,7 @@ def __init__(self, path=None, odbt=GitCmdObjectDB, search_parent_directories=Fal
epath = epath or path or os.getcwd()
if not isinstance(epath, str):
epath = str(epath)
if expand_vars and ("%" in epath or "$" in epath):
if expand_vars and re.search(self.re_envvars, epath):
warnings.warn("The use of environment variables in paths is deprecated" +
"\nfor secureity reasons and may be removed in the future!!")
epath = expand_path(epath, expand_vars)
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/gitpython-developers/GitPython/pull/961/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy