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

Commitbaf3457

Browse files
committed
Fix Git.execute shell use and reporting bugs
This updates the shell variable itself, only when it is None, fromself.USE_SHELL.(That attribute is usually Git.USE_SHELL rather than an instanceattribute. But although people probably shouldn't set it oninstances, people will expect that this is permitted.)Now:- USE_SHELL is used as a fallback only. When shell=False is passed, USE_SHELL is no longer consuled. Thus shell=False always keeps a shell from being used, even in the non-default case where the USE_SHELL attribue has been set to True.- The debug message printed to the log shows the actual value that is being passed to Popen, because the updated shell variable is used both to produce that message and in the Popen call.
1 parent41294d5 commitbaf3457

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎git/cmd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,8 @@ def execute(
974974
istream_ok="None"
975975
ifistream:
976976
istream_ok="<valid stream>"
977+
ifshellisNone:
978+
shell=self.USE_SHELL
977979
log.debug(
978980
"Popen(%s, cwd=%s, universal_newlines=%s, shell=%s, istream=%s)",
979981
redacted_command,
@@ -992,7 +994,7 @@ def execute(
992994
stdin=istreamorDEVNULL,
993995
stderr=PIPE,
994996
stdout=stdout_sink,
995-
shell=shellisnotNoneandshellorself.USE_SHELL,
997+
shell=shell,
996998
close_fds=is_posix,# unsupported on windows
997999
universal_newlines=universal_newlines,
9981000
creationflags=PROC_CREATIONFLAGS,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp