From 2c0b92e40ece170b59bced0cea752904823e06e7 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 27 Oct 2010 20:18:52 +0200 Subject: cmd: improved error handling and debug printing head.reset: will now handle resets with paths much better, especially in the --mixed case, see http://github.com/Byron/GitPython/issues#issue/2 --- lib/git/cmd.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/git/cmd.py') diff --git a/lib/git/cmd.py b/lib/git/cmd.py index cd848e05..60887f5d 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -337,16 +337,18 @@ class Git(object): proc.stdout.close() proc.stderr.close() - if with_exceptions and status != 0: - raise GitCommandError(command, status, stderr_value) - if GIT_PYTHON_TRACE == 'full': + cmdstr = " ".join(command) if stderr_value: - print "%s -> %d: '%s' !! '%s'" % (command, status, stdout_value, stderr_value) + print "%s -> %d; stdout: '%s'; stderr: '%s'" % (cmdstr, status, stdout_value, stderr_value) elif stdout_value: - print "%s -> %d: '%s'" % (command, status, stdout_value) + print "%s -> %d; stdout: '%s'" % (cmdstr, status, stdout_value) else: - print "%s -> %d" % (command, status) + print "%s -> %d" % (cmdstr, status) + # END handle debug printing + + if with_exceptions and status != 0: + raise GitCommandError(command, status, stderr_value) # Allow access to the command's status code if with_extended_output: -- cgit v1.2.1