From 49103833dac62f780226239fb923b90812ab4695 Mon Sep 17 00:00:00 2001 From: Ilya Kulakov Date: Tue, 13 Nov 2018 10:46:18 -0800 Subject: [PATCH] Pass GIT_FLUSH via the env argument instead of command Fixes compatibility with cmd.exe Refs #62 --- git_archive_all.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/git_archive_all.py b/git_archive_all.py index afc28aa..e1f1fad 100755 --- a/git_archive_all.py +++ b/git_archive_all.py @@ -27,7 +27,7 @@ from __future__ import unicode_literals import logging -from os import extsep, path, readlink +from os import environ, extsep, path, readlink from subprocess import CalledProcessError, Popen, PIPE import sys import re @@ -356,8 +356,9 @@ def check_attr(cls, repo_abspath, attrs): @rtype: generator """ def make_process(): - cmd = 'GIT_FLUSH=1 git check-attr --stdin -z {0}'.format(' '.join(attrs)) - return Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, cwd=repo_abspath) + env = dict(environ, GIT_FLUSH='1') + cmd = 'git check-attr --stdin -z {0}'.format(' '.join(attrs)) + return Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, cwd=repo_abspath, env=env) def read_attrs(process, repo_file_path): process.stdin.write(repo_file_path.encode('utf-8') + b'\0')