# HG changeset patch # User Marcin Kuzminski # Date 2013-05-09 11:29:03 # Node ID 08d439bfbd8cde4970a3ea307fef2c2f1bc5c76d # Parent 5067d6e826a5e2cb3fc918aa6a8f9abb7a0b606b fixed handling shell argument in subprocess calls, it always was hardcoded even when passed properly in arguments diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -125,10 +125,11 @@ class GitRepository(BaseRepository): cmd = [_git_path] + _copts + cmd if _str_cmd: cmd = ' '.join(cmd) + try: _opts = dict( env=gitenv, - shell=False, + shell=True, ) _opts.update(opts) p = subprocessio.SubprocessIOChunker(cmd, **_opts) diff --git a/rhodecode/lib/vcs/subprocessio.py b/rhodecode/lib/vcs/subprocessio.py --- a/rhodecode/lib/vcs/subprocessio.py +++ b/rhodecode/lib/vcs/subprocessio.py @@ -342,10 +342,10 @@ class SubprocessIOChunker(object): input_streamer.start() inputstream = input_streamer.output + _shell = kwargs.get('shell', True) if isinstance(cmd, (list, tuple)): cmd = ' '.join(cmd) - _shell = kwargs.get('shell') or True kwargs['shell'] = _shell _p = subprocess.Popen(cmd, bufsize=-1, @@ -353,7 +353,7 @@ class SubprocessIOChunker(object): stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs - ) + ) bg_out = BufferedGenerator(_p.stdout, buffer_size, chunk_size, starting_values) bg_err = BufferedGenerator(_p.stderr, 16000, 1, bottomless=True)