From 6cf74643e9b563c6384a0d23e172c8ea294b7210 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 16 May 2016 14:23:43 +0300 Subject: oeqa.utils.git: introduce GitRepo.rev_parse() (From OE-Core rev: 55726e931536ed0cbd7b80588060b05a3145c934) Signed-off-by: Markus Lehtonen Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/git.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'meta/lib/oeqa/utils/git.py') diff --git a/meta/lib/oeqa/utils/git.py b/meta/lib/oeqa/utils/git.py index 6a2987fbe8..647465467d 100644 --- a/meta/lib/oeqa/utils/git.py +++ b/meta/lib/oeqa/utils/git.py @@ -38,5 +38,12 @@ class GitRepo(object): env.update(env_update) return self._run_git_cmd_at(git_args, self.top_dir, env=env) + def rev_parse(self, revision): + """Do git rev-parse""" + try: + return self.run_cmd(['rev-parse', revision]) + except GitError: + # Revision does not exist + return None -- cgit v1.2.3-54-g00ecf