@@ -405,7 +405,7 @@ def read_all_from_possibly_closed_stream(stream):
405405 if status != 0 :
406406 errstr = read_all_from_possibly_closed_stream (self .proc .stderr )
407407 log .debug ('AutoInterrupt wait stderr: %r' % (errstr ,))
408- raise GitCommandError (self .args , status , errstr )
408+ raise GitCommandError (remove_password_if_present ( self .args ) , status , errstr )
409409 # END status handling
410410 return status
411411 # END auto interrupt
@@ -638,7 +638,7 @@ def execute(self, command,
638638
639639 :param env:
640640 A dictionary of environment variables to be passed to `subprocess.Popen`.
641-
641+
642642 :param max_chunk_size:
643643 Maximum number of bytes in one chunk of data passed to the output_stream in
644644 one invocation of write() method. If the given number is not positive then
@@ -706,7 +706,7 @@ def execute(self, command,
706706 if is_win :
707707 cmd_not_found_exception = OSError
708708 if kill_after_timeout :
709- raise GitCommandError (command , '"kill_after_timeout" feature is not supported on Windows.' )
709+ raise GitCommandError (redacted_command , '"kill_after_timeout" feature is not supported on Windows.' )
710710 else :
711711 if sys .version_info [0 ] > 2 :
712712 cmd_not_found_exception = FileNotFoundError # NOQA # exists, flake8 unknown @UndefinedVariable
@@ -721,7 +721,7 @@ def execute(self, command,
721721 if istream :
722722 istream_ok = "<valid stream>"
723723 log .debug ("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s, istream=%s)" ,
724- command , cwd , universal_newlines , shell , istream_ok )
724+ redacted_command , cwd , universal_newlines , shell , istream_ok )
725725 try :
726726 proc = Popen (command ,
727727 env = env ,
@@ -737,7 +737,7 @@ def execute(self, command,
737737 ** subprocess_kwargs
738738 )
739739 except cmd_not_found_exception as err :
740- raise GitCommandNotFound (command , err ) from err
740+ raise GitCommandNotFound (redacted_command , err ) from err
741741
742742 if as_process :
743743 return self .AutoInterrupt (proc , command )
@@ -787,7 +787,7 @@ def _kill_process(pid):
787787 watchdog .cancel ()
788788 if kill_check .isSet ():
789789 stderr_value = ('Timeout: the command "%s" did not complete in %d '
790- 'secs.' % (" " .join (command ), kill_after_timeout ))
790+ 'secs.' % (" " .join (redacted_command ), kill_after_timeout ))
791791 if not universal_newlines :
792792 stderr_value = stderr_value .encode (defenc )
793793 # strip trailing "\n"
@@ -811,7 +811,7 @@ def _kill_process(pid):
811811 proc .stderr .close ()
812812
813813 if self .GIT_PYTHON_TRACE == 'full' :
814- cmdstr = " " .join (command )
814+ cmdstr = " " .join (redacted_command )
815815
816816 def as_text (stdout_value ):
817817 return not output_stream and safe_decode (stdout_value ) or '<OUTPUT_STREAM>'
@@ -827,7 +827,7 @@ def as_text(stdout_value):
827827 # END handle debug printing
828828
829829 if with_exceptions and status != 0 :
830- raise GitCommandError (command , status , stderr_value , stdout_value )
830+ raise GitCommandError (redacted_command , status , stderr_value , stdout_value )
831831
832832 if isinstance (stdout_value , bytes ) and stdout_as_string : # could also be output_stream
833833 stdout_value = safe_decode (stdout_value )
0 commit comments