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 Sep 17, 2018
1 parent 9e10801 commit ea3952f
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 ea3952f

Please sign in to comment.