File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed
Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -56,15 +56,26 @@ impl Graph {
5656 return None ;
5757 }
5858 } else {
59- for commit in entry. commits {
60- if commit. architecture != scope. basearch || commit. checksum . is_empty ( ) {
61- continue ;
59+ match entry. commits {
60+ Some ( commits) if !commits. is_empty ( ) => {
61+ for commit in commits {
62+ if commit. architecture != scope. basearch
63+ || commit. checksum . is_empty ( )
64+ {
65+ continue ;
66+ }
67+ has_basearch = true ;
68+ current. payload = commit. checksum ;
69+ current
70+ . metadata
71+ . insert ( metadata:: SCHEME . to_string ( ) , "checksum" . to_string ( ) ) ;
72+ }
73+ }
74+ _ => {
75+ // catch-all arm for both `None` and `Some(empty_vec)`,
76+ // both cases should result in skipping the release.
77+ return None ;
6278 }
63- has_basearch = true ;
64- current. payload = commit. checksum ;
65- current
66- . metadata
67- . insert ( metadata:: SCHEME . to_string ( ) , "checksum" . to_string ( ) ) ;
6879 }
6980 }
7081
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ pub struct ReleasesJSON {
3131
3232#[ derive( Clone , Debug , Deserialize ) ]
3333pub struct Release {
34- pub commits : Vec < ReleaseCommit > ,
34+ pub commits : Option < Vec < ReleaseCommit > > ,
3535 #[ serde( rename = "oci-images" ) ]
3636 pub oci_images : Option < Vec < ReleaseOciImage > > ,
3737 pub version : String ,
You can’t perform that action at this time.
0 commit comments