oeqa.utils.git: support git commands with updated env
Extend GitRepo.run_cmd so that the caller may redefine and/or define additional environment variables that will be used when the git command is run. (From OE-Core rev: 9b3c7c47f5d0fa473fe1db81b59b26531414781c) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
665800fdf6
commit
7fcc9f5ead
|
@ -30,9 +30,13 @@ class GitRepo(object):
|
|||
cmd_str, ret.status, ret.output))
|
||||
return ret.output.strip()
|
||||
|
||||
def run_cmd(self, git_args):
|
||||
def run_cmd(self, git_args, env_update=None):
|
||||
"""Run Git command"""
|
||||
return self._run_git_cmd_at(git_args, self.top_dir)
|
||||
env = None
|
||||
if env_update:
|
||||
env = os.environ.copy()
|
||||
env.update(env_update)
|
||||
return self._run_git_cmd_at(git_args, self.top_dir, env=env)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue