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

Commitb56d677

Browse files
committed
Added ability to silence initial warning
Added the ability to silence the first refresh warning upon import bysetting an environment variable.
1 parente8cb31d commitb56d677

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

‎git/cmd.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,19 @@ def refresh(cls, path=None):
231231
# None) we only warn the user and simply set the default
232232
# executable
233233
cls.GIT_PYTHON_GIT_EXECUTABLE=cls.git_exec_name
234-
print(dedent("""\
235-
WARNING: %s
236-
All git commands will error until this is rectified.
237-
""")%err)
234+
235+
# test if the user didn't want a warning
236+
nowarn=os.environ.get("GIT_PYTHON_NOWARN","false")
237+
nowarn=nowarn.lower()in ["t","true","y","yes"]
238+
239+
ifnotnowarn:
240+
print(dedent("""\
241+
WARNING: %s
242+
All git commands will error until this is rectified.
243+
244+
This initial warning can be silenced in the future by setting the environment variable:
245+
export GIT_PYTHON_NOWARN=true
246+
""")%err)
238247
else:
239248
# after the first setup (when GIT_PYTHON_GIT_EXECUTABLE
240249
# is no longer None) we raise an exception and reset the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp