summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-21 18:34:58 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-21 18:34:58 +0100
commite4d3809161fc54d6913c0c2c7f6a7b51eebe223f (patch)
tree1eebc9f43a1302c537da84e9a7219918da131f45 /git/cmd.py
parente48e52001d5abad7b28a4ecadde63c78c3946339 (diff)
downloadgitpython-e4d3809161fc54d6913c0c2c7f6a7b51eebe223f.tar.gz
Added advance usage examples to tutorial and made minor fixes.
GIT_PYTHON_TRACE would actually fail (now) if we debugged archive operations. Related to #239
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/git/cmd.py b/git/cmd.py
index d6b29d91..55ed74dd 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -579,11 +579,16 @@ class Git(LazyMixin):
if self.GIT_PYTHON_TRACE == 'full':
cmdstr = " ".join(command)
+
+ def as_text(stdout_value):
+ return not output_stream and stdout_value.decode(defenc) or '<OUTPUT_STREAM>'
+ # end
+
if stderr_value:
log.info("%s -> %d; stdout: '%s'; stderr: '%s'",
- cmdstr, status, stdout_value.decode(defenc), stderr_value.decode(defenc))
+ cmdstr, status, as_text(stdout_value), stderr_value.decode(defenc))
elif stdout_value:
- log.info("%s -> %d; stdout: '%s'", cmdstr, status, stdout_value.decode(defenc))
+ log.info("%s -> %d; stdout: '%s'", cmdstr, status, as_text(stdout_value))
else:
log.info("%s -> %d", cmdstr, status)
# END handle debug printing