diff options
author | Jürg Billeter <j@bitron.ch> | 2019-08-29 21:12:49 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-08-30 07:30:10 +0200 |
commit | e9978cdd675f1fcf3d0de49bb38908fd25194c8a (patch) | |
tree | 5ab15263440fbf0f05924db6650fa3b82c561c7b | |
parent | 1c0f161aa48fc39d1f88fa407189b30075c3e1f0 (diff) | |
download | buildstream-e9978cdd675f1fcf3d0de49bb38908fd25194c8a.tar.gz |
tests/testutils/repo/git.py: Do not ignore environment variables
Merge `os.environ` and `GIT_ENV` instead of replacing the existing
(tox) environment variables such as HOME and XDG_CONFIG_HOME.
-rw-r--r-- | tests/testutils/repo/git.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/testutils/repo/git.py b/tests/testutils/repo/git.py index ba1590273..46694fcf2 100644 --- a/tests/testutils/repo/git.py +++ b/tests/testutils/repo/git.py @@ -18,11 +18,14 @@ class Git(Repo): super().__init__(directory, subdir) + self.env = os.environ.copy() + self.env.update(GIT_ENV) + def _run_git(self, *args, **kwargs): argv = [GIT] argv.extend(args) if 'env' not in kwargs: - kwargs['env'] = dict(GIT_ENV, PWD=self.repo) + kwargs['env'] = dict(self.env, PWD=self.repo) kwargs.setdefault('cwd', self.repo) kwargs.setdefault('check', True) return subprocess.run(argv, **kwargs) |