Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit313b3b4

Browse files
rgkimballByron
authored andcommitted
Avoids env var warning when path contains $/%;fix#832
1 parent85cf7e8 commit313b3b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎git/repo/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class Repo(object):
7777
re_whitespace=re.compile(r'\s+')
7878
re_hexsha_only=re.compile('^[0-9A-Fa-f]{40}$')
7979
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?%)')
8081
re_author_committer_start=re.compile(r'^(author|committer)')
8182
re_tab_full_line=re.compile(r'^\t(.*)$')
8283

@@ -125,7 +126,7 @@ def __init__(self, path=None, odbt=GitCmdObjectDB, search_parent_directories=Fal
125126
epath=epathorpathoros.getcwd()
126127
ifnotisinstance(epath,str):
127128
epath=str(epath)
128-
ifexpand_varsand("%"inepathor"$"inepath):
129+
ifexpand_varsandre.search(self.re_envvars,epath):
129130
warnings.warn("The use of environment variables in paths is deprecated"+
130131
"\nfor security reasons and may be removed in the future!!")
131132
epath=expand_path(epath,expand_vars)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp