Skip to content

Commit 7dba42e

Browse files
Handle undefined ref values in dependencies file (#174)
Treat unset ref fields in the dependencies.yaml file as empty strings to avoid passing None through to underlying git commands.
1 parent 9297ded commit 7dba42e

2 files changed

Lines changed: 33 additions & 24 deletions

File tree

github_scripts/merge_sources.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,23 @@ def main():
8787
if not isinstance(opts, list):
8888
opts = [opts]
8989

90-
# Clone the first provided source
91-
values = opts.pop(0)
92-
get_source(
93-
values["source"],
94-
values["ref"],
95-
dest,
96-
dependency,
97-
args.mirrors,
98-
args.mirror_loc,
99-
)
100-
# For all other sources, attempt to merge into the first
101-
for values in opts:
90+
for i, values in enumerate(opts):
91+
if values["ref"] is None:
92+
values["ref"] = ""
93+
94+
# Clone the first provided source
95+
if i == 0:
96+
get_source(
97+
values["source"],
98+
values["ref"],
99+
dest,
100+
dependency,
101+
args.mirrors,
102+
args.mirror_loc,
103+
)
104+
continue
105+
106+
# For all other sources, attempt to merge into the first
102107
merge_source(
103108
values["source"],
104109
values["ref"],

github_scripts/rose_stem_extract_source.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,22 @@ def main() -> None:
5050
if not isinstance(opts, list):
5151
opts = [opts]
5252

53-
# Clone the first provided source
54-
values = opts.pop(0)
55-
get_source(
56-
values["source"],
57-
values["ref"],
58-
loc,
59-
dependency,
60-
use_mirrors,
61-
mirror_loc,
62-
)
63-
# For all other sources, attempt to merge into the first
64-
for values in opts:
53+
for i, values in enumerate(opts):
54+
if values["ref"] is None:
55+
values["ref"] = ""
56+
57+
# Clone the first provided source
58+
if i == 0:
59+
get_source(
60+
values["source"],
61+
values["ref"],
62+
loc,
63+
dependency,
64+
use_mirrors,
65+
mirror_loc,
66+
)
67+
continue
68+
# For all other sources, attempt to merge into the first
6569
merge_source(
6670
values["source"],
6771
values["ref"],

0 commit comments

Comments
 (0)