diff options
author | Barry Scott <barry@barrys-emacs.org> | 2016-05-28 13:23:18 +0100 |
---|---|---|
committer | Barry Scott <barry@barrys-emacs.org> | 2016-05-28 13:23:18 +0100 |
commit | d255f4c8fd905d1cd12bd42b542953d54ac8a8c3 (patch) | |
tree | faffbb7ad5eb0d21ff0920791842aa7446332e1c /git/cmd.py | |
parent | b4492c7965cd8e3c5faaf28b2a6414b04984720b (diff) | |
parent | c5077dac4c7680c925f4c5e792eeb3c296a3b4c4 (diff) | |
download | gitpython-d255f4c8fd905d1cd12bd42b542953d54ac8a8c3.tar.gz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -13,7 +13,7 @@ import threading import errno import mmap -from collections import OrderedDict +from git.odict import OrderedDict from contextlib import contextmanager import signal @@ -44,7 +44,8 @@ from git.compat import ( execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', 'with_exceptions', 'as_process', 'stdout_as_string', - 'output_stream', 'with_stdout', 'kill_after_timeout') + 'output_stream', 'with_stdout', 'kill_after_timeout', + 'universal_newlines') log = logging.getLogger('git.cmd') log.addHandler(logging.NullHandler()) @@ -487,6 +488,7 @@ class Git(LazyMixin): stdout_as_string=True, kill_after_timeout=None, with_stdout=True, + universal_newlines=False, **subprocess_kwargs ): """Handles executing the command on the shell and consumes and returns @@ -541,7 +543,9 @@ class Git(LazyMixin): specify may not be the same ones. :param with_stdout: If True, default True, we open stdout on the created process - + :param universal_newlines: + if True, pipes will be opened as text, and lines are split at + all known line endings. :param kill_after_timeout: To specify a timeout in seconds for the git command, after which the process should be killed. This will have no effect if as_process is set to True. It is @@ -605,9 +609,10 @@ class Git(LazyMixin): bufsize=-1, stdin=istream, stderr=PIPE, - stdout=with_stdout and PIPE or open(os.devnull, 'wb'), + stdout=PIPE if with_stdout else open(os.devnull, 'wb'), shell=self.USE_SHELL, close_fds=(os.name == 'posix'), # unsupported on windows + universal_newlines=universal_newlines, **subprocess_kwargs ) except cmd_not_found_exception as err: |