]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa.utils.git: support git commands with updated env
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 13 May 2016 13:34:04 +0000 (16:34 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 25 Aug 2016 21:59:54 +0000 (22:59 +0100)
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.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/utils/git.py

index a4c6741f4e52f6064b87aafd477351b212303fc7..6a2987fbe809c64c8bdf07077833ac7dab4b2c9f 100644 (file)
@@ -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)