From 614dc938c1d4eba4e08916bea48957cbca0fa79f Mon Sep 17 00:00:00 2001 From: James Bruten <109733895+james-bruten-mo@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:36:30 +0000 Subject: [PATCH] handle undefined ref --- github_scripts/merge_sources.py | 29 +++++++++++++--------- github_scripts/rose_stem_extract_source.py | 28 ++++++++++++--------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/github_scripts/merge_sources.py b/github_scripts/merge_sources.py index db47d5b..de3577c 100755 --- a/github_scripts/merge_sources.py +++ b/github_scripts/merge_sources.py @@ -87,18 +87,23 @@ def main(): if not isinstance(opts, list): opts = [opts] - # Clone the first provided source - values = opts.pop(0) - get_source( - values["source"], - values["ref"], - dest, - dependency, - args.mirrors, - args.mirror_loc, - ) - # For all other sources, attempt to merge into the first - for values in opts: + for i, values in enumerate(opts): + if values["ref"] is None: + values["ref"] = "" + + # Clone the first provided source + if i == 0: + get_source( + values["source"], + values["ref"], + dest, + dependency, + args.mirrors, + args.mirror_loc, + ) + continue + + # For all other sources, attempt to merge into the first merge_source( values["source"], values["ref"], diff --git a/github_scripts/rose_stem_extract_source.py b/github_scripts/rose_stem_extract_source.py index 4b42e79..43b8f75 100755 --- a/github_scripts/rose_stem_extract_source.py +++ b/github_scripts/rose_stem_extract_source.py @@ -50,18 +50,22 @@ def main() -> None: if not isinstance(opts, list): opts = [opts] - # Clone the first provided source - values = opts.pop(0) - get_source( - values["source"], - values["ref"], - loc, - dependency, - use_mirrors, - mirror_loc, - ) - # For all other sources, attempt to merge into the first - for values in opts: + for i, values in enumerate(opts): + if values["ref"] is None: + values["ref"] = "" + + # Clone the first provided source + if i == 0: + get_source( + values["source"], + values["ref"], + loc, + dependency, + use_mirrors, + mirror_loc, + ) + continue + # For all other sources, attempt to merge into the first merge_source( values["source"], values["ref"],