summaryrefslogtreecommitdiff
path: root/bin/just-mr.py
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-05-04 15:28:10 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-05-05 09:38:56 +0200
commit1a21b3ccd09e5cebf60e944f5adc74ae7383f160 (patch)
tree8d651b2ae59e7bca53a05149e938b96c07dbbf85 /bin/just-mr.py
parent11c1e80886847f0a4e4aec682eb68bd76bf45c6a (diff)
downloadjustbuild-1a21b3ccd09e5cebf60e944f5adc74ae7383f160.tar.gz
just-mr: extend git environment
... and also use it for "git init" and "git add" as well, to avoid effects of unusual git configurations.
Diffstat (limited to 'bin/just-mr.py')
-rwxr-xr-xbin/just-mr.py14
1 files changed, 12 insertions, 2 deletions
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,