Skip to content

Commit

Permalink
GitRepository: slightly change handling of extra_env arg
Browse files Browse the repository at this point in the history
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 <markus.lehtonen@linux.intel.com>
  • Loading branch information
marquiz committed Jan 23, 2018
1 parent b95260a commit fba3864
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gbp/git/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fba3864

Please sign in to comment.