aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/wrap/wrap.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-01-22 19:30:46 +0530
committerXavier Claessens <xclaesse@gmail.com>2020-01-22 17:29:38 -0500
commite962147d8a1a1551868d7f261f812430d2778304 (patch)
treec0b66b1ab625146a2f63719276d82c8b5fb9d6a6 /mesonbuild/wrap/wrap.py
parentf09056f90378c9e1f8161e59782d16b2e2f1ac7f (diff)
downloadmeson-e962147d8a1a1551868d7f261f812430d2778304.zip
meson-e962147d8a1a1551868d7f261f812430d2778304.tar.gz
meson-e962147d8a1a1551868d7f261f812430d2778304.tar.bz2
wrap: Redirect stdin to DEVNULL when calling git
Without this git messes up the console and ANSI colors stop working on Windows inside cmd.exe. This broke in https://github.com/mesonbuild/meson/pull/6139. Also add the same to all git calls. Missed this when I opened https://github.com/mesonbuild/meson/pull/6255
Diffstat (limited to 'mesonbuild/wrap/wrap.py')
-rw-r--r--mesonbuild/wrap/wrap.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
index 66b0c8c..64bc88e 100644
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -49,7 +49,10 @@ SSL_WARNING_PRINTED = False
WHITELIST_SUBDOMAIN = 'wrapdb.mesonbuild.com'
def git(cmd: T.List[str], workingdir: str, **kwargs) -> subprocess.CompletedProcess:
- pc = subprocess.run([GIT, '-C', workingdir] + cmd, **kwargs)
+ pc = subprocess.run([GIT, '-C', workingdir] + cmd,
+ # Redirect stdin to DEVNULL otherwise git messes up the
+ # console and ANSI colors stop working on Windows.
+ stdin=subprocess.DEVNULL, **kwargs)
return pc
def quiet_git(cmd: T.List[str], workingdir: str) -> T.Tuple[bool, str]: