mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
oeqa.utils.git: introduce GitRepo.rev_parse()
(From OE-Core rev: 55726e931536ed0cbd7b80588060b05a3145c934) 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:
committed by
Richard Purdie
parent
7fcc9f5ead
commit
6cf74643e9
@@ -114,7 +114,7 @@ class BuildPerfTestResult(unittest.TextTestResult):
|
||||
"and OE_BUILDPERFTEST_GIT_BRANCH environment variables")
|
||||
else:
|
||||
if not rev:
|
||||
rev = self.repo.run_cmd(['rev-parse', 'HEAD'])
|
||||
rev = self.repo.rev_parse('HEAD')
|
||||
if not branch:
|
||||
try:
|
||||
# Strip 11 chars, i.e. 'refs/heads' from the beginning
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user