oeqa.utils.metadata: drop 'unknown' git data elements

It's better just to not have the xml elements than to have elements with
faux data. One could have git branch named 'unknown', for example.

[YOCTO #10590]

(From OE-Core rev: fce531c21f5e56d0f416b3405a0b0fc5ba567679)

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-01-13 15:12:39 +02:00
committed by Richard Purdie
parent df8c0540e4
commit 4e67232f34
2 changed files with 5 additions and 6 deletions

View File

@@ -73,11 +73,10 @@ def get_layers(layers):
try:
repo = Repo(layer, search_parent_directories=True)
revision, branch = repo.head.object.name_rev.split()
layer_dict[layer_name]['branch'] = branch
layer_dict[layer_name]['revision'] = revision
except (InvalidGitRepositoryError, NoSuchPathError):
layer_dict[layer_name]['branch'] = 'unknown'
layer_dict[layer_name]['revision'] = 'unknown'
continue
layer_dict[layer_name]['branch'] = branch
layer_dict[layer_name]['revision'] = revision
return layer_dict
def write_metadata_file(file_path, metadata):