From fba3864a292681e67666e1b00bfff4002d1a9936 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Tue, 23 Jan 2018 14:14:50 +0200 Subject: [PATCH] GitRepository: slightly change handling of extra_env arg No need to build 'env' arg for popen when extra_env is empty. In some methods an empty dict is used to indicate "no extra env". This commit does not affect the output/outcome of GitRepository operations, but, just makes the code a tiny bit sleeker. Signed-off-by: Markus Lehtonen --- gbp/git/repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 0888fadb..65449728 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -134,7 +134,7 @@ def __init__(self, path, toplevel=True): def __build_env(extra_env): """Prepare environment for subprocess calls""" env = None - if extra_env is not None: + if extra_env: env = os.environ.copy() env.update(extra_env) return env