summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/source/changes.rst2
-rw-r--r--git/cmd.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/source/changes.rst b/doc/source/changes.rst
index 8cc9ca0d..b14df90a 100644
--- a/doc/source/changes.rst
+++ b/doc/source/changes.rst
@@ -7,6 +7,8 @@ Changelog
* Fix: progress handler exceptions are not caught anymore, which would usually just hide bugs
previously.
+* Fix: The `Git.execute` method will now redirect `stdout` to `devnull` if `with_stdout` is false,
+ which is the intended behaviour based on the parameter's documentation.
2.0.2 - Fixes
=============
diff --git a/git/cmd.py b/git/cmd.py
index 8a657dc1..eef52534 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -605,7 +605,7 @@ class Git(LazyMixin):
bufsize=-1,
stdin=istream,
stderr=PIPE,
- stdout=with_stdout and PIPE or None,
+ stdout=with_stdout and PIPE or open(os.devnull, 'wb'),
shell=self.USE_SHELL,
close_fds=(os.name == 'posix'), # unsupported on windows
**subprocess_kwargs