From cf37099ea8d1d8c7fbf9b6d12d7ec0249d3acb8b Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Mon, 11 Aug 2008 20:48:41 +0200 Subject: use shell=True in windows (git.exe needs to be on %PATH%) One bug remaining: git on windows is returning status 0 for `git this-does-not-exist`, so no GitCommandError is raised. --- lib/git/cmd.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/git/cmd.py') diff --git a/lib/git/cmd.py b/lib/git/cmd.py index 38cfe3bd..c7ec38f6 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -1,10 +1,10 @@ -# cmd.py +# cmd.py # Copyright (C) 2008 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php -import os +import os, sys import subprocess import re from utils import * @@ -16,6 +16,10 @@ GIT_PYTHON_TRACE = os.environ.get("GIT_PYTHON_TRACE", False) execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', 'with_exceptions', 'with_raw_output') +extra = {} +if sys.platform == 'win32': + extra = {'shell': True} + class Git(object): """ The Git class manages communication with the Git binary @@ -83,7 +87,8 @@ class Git(object): cwd=cwd, stdin=istream, stderr=subprocess.PIPE, - stdout=subprocess.PIPE + stdout=subprocess.PIPE, + **extra ) # Wait for the process to return -- cgit v1.2.1