[OE-core] [PATCH 10/19] oeqa.utils.git: implement init() method

Markus Lehtonen markus.lehtonen at linux.intel.com
Wed Aug 24 07:13:00 UTC 2016


Method for doing 'git init'.

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
---
 meta/lib/oeqa/utils/git.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/lib/oeqa/utils/git.py b/meta/lib/oeqa/utils/git.py
index ca84680..ae85d27 100644
--- a/meta/lib/oeqa/utils/git.py
+++ b/meta/lib/oeqa/utils/git.py
@@ -35,6 +35,12 @@ class GitRepo(object):
                 cmd_str, ret.status, ret.output))
         return ret.output.strip()
 
+    @staticmethod
+    def init(path):
+        """Initialize a new Git repository"""
+        GitRepo._run_git_cmd_at('init', cwd=path)
+        return GitRepo(path, is_topdir=True)
+
     def run_cmd(self, git_args, env_update=None):
         """Run Git command"""
         env = None
-- 
2.6.6




More information about the Openembedded-core mailing list