summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHermes Agent <hermes@localhost>2026-08-12 02:11:06 +0000
committerHermes Agent <hermes@localhost>2026-08-12 02:11:06 +0000
commit0d60d812c4dcf78a18dcc59325dc1ec609cf8eb8 (patch)
tree326a4dc80cc81d87bbae8b4537c9e47f5a04c8bb /src
parent271ccc76ad22436b7e0d5291168a5d18c57bb77b (diff)
Distinguish initrd additions and removals
Diffstat (limited to 'src')
-rw-r--r--src/compare.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compare.rs b/src/compare.rs
index 7088886..8b59c1c 100644
--- a/src/compare.rs
+++ b/src/compare.rs
@@ -70,8 +70,13 @@ pub fn compare(left: &ArtifactManifest, right: &ArtifactManifest) -> ComparisonR
compare_records(&left.files, &right.files, |record| &record.path, |path, change| {
SemanticDifference::File { path: path.to_owned(), change }
}, &mut differences);
- if left.initrd != right.initrd {
- differences.push(SemanticDifference::Initrd { change: Change::Changed });
+ match (&left.initrd, &right.initrd) {
+ (None, Some(_)) => differences.push(SemanticDifference::Initrd { change: Change::Added }),
+ (Some(_), None) => differences.push(SemanticDifference::Initrd { change: Change::Removed }),
+ (Some(left), Some(right)) if left != right => {
+ differences.push(SemanticDifference::Initrd { change: Change::Changed });
+ }
+ _ => {}
}
compare_records(&left.services, &right.services, |record| &record.name, |name, change| {
SemanticDifference::Service { name: name.to_owned(), change }