From b542cca266972d6f78afe52d9a9a1a56a3f90d7d Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Mon, 18 Mar 2019 17:44:47 +0000 Subject: [PATCH] git_test_utils: Copy os.environ in get_git_commit_env() Instead of creating an empty dict and setting all the required git variables there, add those variables to os.environ so that we do not drop other required variables -- in my case, git was not in /usr/bin so invoking 'git commit' in _add_schema_commit fails with "no such file or directory". Change-Id: I8c9b14e1f534efc8f40d21b312a5396b2f65f4a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528290 Auto-Submit: Raphael Kubo da Costa Commit-Queue: Robbie Iannucci Reviewed-by: Robbie Iannucci --- testing_support/git_test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing_support/git_test_utils.py b/testing_support/git_test_utils.py index 619844339..e580d7f06 100644 --- a/testing_support/git_test_utils.py +++ b/testing_support/git_test_utils.py @@ -355,7 +355,7 @@ class GitRepo(object): def get_git_commit_env(self, commit_data=None): commit_data = commit_data or {} - env = {} + env = os.environ.copy() for prefix in ('AUTHOR', 'COMMITTER'): for suffix in ('NAME', 'EMAIL', 'DATE'): singleton = '%s_%s' % (prefix, suffix)