use submitted branch as default ref for components

This commit is contained in:
Mike McLean
2022-08-09 09:54:04 -04:00
parent d1180871de
commit 79648cf188

View File

@@ -281,6 +281,8 @@ def format_mmd(mmd, scmurl, module=None, db_session=None, srpm_overrides=None):
xmd["mbs"]["commit"] = full_scm_hash
default_ref = xmd["mbs"].get("branch") or conf.default_branch
if mmd.get_rpm_component_names() or mmd.get_module_component_names():
if "rpms" not in xmd["mbs"]:
xmd["mbs"]["rpms"] = {}
@@ -309,7 +311,7 @@ def format_mmd(mmd, scmurl, module=None, db_session=None, srpm_overrides=None):
if not pkg.get_cache():
pkg.set_cache(conf.rpms_default_cache + pkgname)
if not pkg.get_ref():
pkg.set_ref(conf.default_branch)
pkg.set_ref(default_ref)
if not pkg.get_arches():
for arch in conf.arches:
pkg.add_restricted_arch(arch)
@@ -325,7 +327,7 @@ def format_mmd(mmd, scmurl, module=None, db_session=None, srpm_overrides=None):
if not mod.get_repository():
mod.set_repository(conf.modules_default_repository + modname)
if not mod.get_ref():
mod.set_ref(conf.default_branch)
mod.set_ref(default_ref)
# It is possible to override the ref of RPM component using
# the rpm_component_ref_overrides.