From 1a21b3ccd09e5cebf60e944f5adc74ae7383f160 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 4 May 2022 15:28:10 +0200 Subject: just-mr: extend git environment ... and also use it for "git init" and "git add" as well, to avoid effects of unusual git configurations. --- bin/just-mr.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bin/just-mr.py') diff --git a/bin/just-mr.py b/bin/just-mr.py index 1cb389c5..090fef7d 100755 --- a/bin/just-mr.py +++ b/bin/just-mr.py @@ -40,6 +40,8 @@ GIT_NOBODY_ENV ={ "GIT_COMMITTER_DATE": "1970-01-01T00:00Z", "GIT_COMMITTER_NAME": "Nobody", "GIT_COMMITTER_EMAIL": "nobody@example.org", + "GIT_CONFIG_GLOBAL": "/dev/null", + "GIT_CONFIG_SYSTEM": "/dev/null", } @@ -281,8 +283,16 @@ def archive_checkout(desc, repo_type="archive", *, fetch_only=False): run_cmd(["tar", "xf", cas_path(content_id)], cwd=target) if ALWAYS_FILE: return ["file", subdir_path(target, desc)] - run_cmd(["git", "init"], cwd=target) - run_cmd(["git", "add", "."], cwd=target) + run_cmd( + ["git", "init"], + cwd=target, + env=dict(os.environ, **GIT_NOBODY_ENV), + ) + run_cmd( + ["git", "add", "."], + cwd=target, + env=dict(os.environ, **GIT_NOBODY_ENV), + ) run_cmd( ["git", "commit", "-m", "Content of %s %r" % (repo_type, content_id)], cwd=target, -- cgit v1.2.3