summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-02-25 13:29:25 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-02-28 14:57:48 +0100
commit7843f3a4a81ab735f16ea37aaf220a5e46c03cc9 (patch)
tree8b559a2bc766f56769d2d62917a09c719e5a16cd /bin
parent11819ed51503022dd2da61c3c58adedb5175b357 (diff)
downloadjustbuild-7843f3a4a81ab735f16ea37aaf220a5e46c03cc9.tar.gz
just-lock: Always use os.environ.copy()
Diffstat (limited to 'bin')
-rwxr-xr-xbin/just-lock.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/just-lock.py b/bin/just-lock.py
index ef5c75b3..0c1abcd2 100755
--- a/bin/just-lock.py
+++ b/bin/just-lock.py
@@ -291,7 +291,7 @@ def git_keep(commit: str, *, upstream: Optional[str],
fail_context: str) -> None:
"""Keep commit by tagging it. It is a user error if the referenced Git
repository does not exist."""
- git_env = {**os.environ, **GIT_NOBODY_ENV}
+ git_env = {**os.environ.copy(), **GIT_NOBODY_ENV}
run_cmd(g_LAUNCHER + [
g_GIT, "tag", "-f", "-m", "Keep referenced tree alive",
"keep-%s" % (commit, ), commit
@@ -502,7 +502,7 @@ def import_to_git(target: str, *, repo_type: str, content_id: str,
"Writing tree to temporary repository failed with:\n%r" % (ex, ))
# Commit the tree
- git_env = {**os.environ, **GIT_NOBODY_ENV}
+ git_env = {**os.environ.copy(), **GIT_NOBODY_ENV}
commit: str = run_cmd(g_LAUNCHER + [
g_GIT, "commit-tree", tree_id, "-m",
"Content of %s %r" % (repo_type, content_id)
@@ -1786,7 +1786,7 @@ def git_tree_checkout(command: List[str], do_generate: bool, *,
fail_context += "While checking out Git-tree:\n"
# Set the command environment
- curr_env = os.environ
+ curr_env = os.environ.copy()
new_envs = {}
for envar in inherit_env:
if envar in curr_env:
@@ -2375,7 +2375,7 @@ def clone_repo(repos: Json, known_repo: str, deps_chain: List[str],
"Expected field \"inherit env\" to be a list, but found:\n%r" %
(json.dumps(inherit_env, indent=2), ))
# Get the actual command environment
- curr_env = os.environ
+ curr_env = os.environ.copy()
new_envs = {}
for envar in inherit_env:
if envar in curr_env: