summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-08-15 15:19:44 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-25 23:03:47 +0100
commit6d9c52fe4b6c8789bb81bbc469c9f418edaef244 (patch)
treec3a6c80f75d895f65e27fb4abadd03b6e429d3c7
parent96e8337830149f43abfe34a41269dbf10cd055a2 (diff)
downloadopenembedded-core-contrib-6d9c52fe4b6c8789bb81bbc469c9f418edaef244.tar.gz
openembedded-core-contrib-6d9c52fe4b6c8789bb81bbc469c9f418edaef244.tar.bz2
openembedded-core-contrib-6d9c52fe4b6c8789bb81bbc469c9f418edaef244.zip
oeqa.utils.git: implement init() method
Method for doing 'git init'. (From OE-Core rev: c848e1dac68cd859a563a82286f8bc5ddabaa423) 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>
-rw-r--r--meta/lib/oeqa/utils/git.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/git.py b/meta/lib/oeqa/utils/git.py
index ca84680118..ae85d27663 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