mirror of
https://git.yoctoproject.org/poky
synced 2026-03-19 13:49:41 +01:00
metadata_scm: Ensure that if an SCM isn't present, we dont print a revision of 'fatal:' as it looks bad
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
committed by
Saul Wold
parent
23bae7e299
commit
411910bb98
@@ -70,8 +70,11 @@ def base_get_metadata_git_branch(path, d):
|
||||
return "<unknown>"
|
||||
|
||||
def base_get_metadata_git_revision(path, d):
|
||||
rev = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path).read().split(" ")[0]
|
||||
if len(rev) != 0:
|
||||
return rev
|
||||
f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path)
|
||||
data = f.read()
|
||||
if f.close() is None:
|
||||
rev = data.split(" ")[0]
|
||||
if len(rev) != 0:
|
||||
return rev
|
||||
return "<unknown>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user