oeqa.utils.git: use --verify in rev_parse()

We use rev-parse for turning git object names into SHA-1 and checking
their existence. Using --verify option makes sure git-rev-parse does
what we expect.

(From OE-Core rev: f5b420c7f07a008c11d492b055c7cc8869f644d3)

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:
Markus Lehtonen
2017-05-15 14:18:41 +03:00
committed by Richard Purdie
parent a7c686cfe6
commit 0aafcddab0

View File

@@ -64,7 +64,7 @@ class GitRepo(object):
def rev_parse(self, revision):
"""Do git rev-parse"""
try:
return self.run_cmd(['rev-parse', revision])
return self.run_cmd(['rev-parse', '--verify', revision])
except GitError:
# Revision does not exist
return None