Skip to content

Commit

Permalink
fix: mark records as changed if hash Option value is different
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejager committed Sep 21, 2024
1 parent ba27ec6 commit b5adf31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/rattler/src/install/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ fn is_python_record(record: &PackageRecord) -> bool {

/// Returns true if the `from` and `to` describe the same package content
fn describe_same_content(from: &PackageRecord, to: &PackageRecord) -> bool {
// If one hash is set and the other is not, the packages are different
if from.sha256.is_some() != to.sha256.is_some() || from.md5.is_some() != to.md5.is_some() {
return false;
}

// If the hashes of the packages match we consider them to be equal
if let (Some(a), Some(b)) = (from.sha256.as_ref(), to.sha256.as_ref()) {
return a == b;
Expand Down

0 comments on commit b5adf31

Please sign in to comment.