From 5fb9c6a5b35220e27b3acd5861318584588cd0d8 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Tue, 8 Nov 2022 00:54:56 +0000 Subject: v2.29.7: Revert back to v2.29.5 This change reverts stable to v2.29.5, to fix clients that received v2.29.6, and keep future updates simpler. Change-Id: I2f5c52c466b7321665c9699ccdbf98f928483fee --- git_command.py | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'git_command.py') diff --git a/git_command.py b/git_command.py index 56e18e02..19100fa9 100644 --- a/git_command.py +++ b/git_command.py @@ -230,11 +230,12 @@ class GitCommand(object): stderr = (subprocess.STDOUT if merge_output else (subprocess.PIPE if capture_stderr else None)) - dbg = '' if IsTrace(): global LAST_CWD global LAST_GITDIR + dbg = '' + if cwd and LAST_CWD != cwd: if LAST_GITDIR or LAST_CWD: dbg += '\n' @@ -262,31 +263,31 @@ class GitCommand(object): dbg += ' 2>|' elif stderr == subprocess.STDOUT: dbg += ' 2>&1' + Trace('%s', dbg) + + try: + p = subprocess.Popen(command, + cwd=cwd, + env=env, + encoding='utf-8', + errors='backslashreplace', + stdin=stdin, + stdout=stdout, + stderr=stderr) + except Exception as e: + raise GitError('%s: %s' % (command[1], e)) - with Trace('git command %s %s with debug: %s', LAST_GITDIR, command, dbg): - try: - p = subprocess.Popen(command, - cwd=cwd, - env=env, - encoding='utf-8', - errors='backslashreplace', - stdin=stdin, - stdout=stdout, - stderr=stderr) - except Exception as e: - raise GitError('%s: %s' % (command[1], e)) - - if ssh_proxy: - ssh_proxy.add_client(p) + if ssh_proxy: + ssh_proxy.add_client(p) - self.process = p + self.process = p - try: - self.stdout, self.stderr = p.communicate(input=input) - finally: - if ssh_proxy: - ssh_proxy.remove_client(p) - self.rc = p.wait() + try: + self.stdout, self.stderr = p.communicate(input=input) + finally: + if ssh_proxy: + ssh_proxy.remove_client(p) + self.rc = p.wait() @staticmethod def _GetBasicEnv(): -- cgit v1.2.3-54-g00ecf