Skip to content

Commit

Permalink
Merge branch 'allow-moved-stuff'
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jan 26, 2024
2 parents b684fcb + 54e0a84 commit d472a8d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/git/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,18 @@ pub fn change_since_last_release(package: &Package, ctx: &crate::Context) -> any
.peel_to_entry(components.clone())?
.unwrap_or_else(|| panic!("path '{}' must exist in current_commit `{}`", dir, current_commit))
.object_id();
let released_dir_id = released_target
if let Some(released_dir_entry) = released_target
.object()?
.peel_to_kind(object::Kind::Tree)?
.into_tree()
.peel_to_entry(components)?
.unwrap_or_else(|| {
panic!(
"path '{}' in released_target commit `{}` must exist as it was supposedly released there. Was it moved to a different directory?",
dir, released_target
)
})
.object_id();

(released_dir_id != current_dir_id).then_some(PackageChangeKind::ChangedOrNew)
{
let released_dir_id = released_dir_entry.object_id();
(released_dir_id != current_dir_id).then_some(PackageChangeKind::ChangedOrNew)
} else {
log::warn!("Expected path '{dir}' to exist in the last released commit `{released_target}` but it doesn't. Was it moved from a different directory? The generated changelog may miss some changes.");
Some(PackageChangeKind::ChangedOrNew)
}
}
}
}
Expand Down

0 comments on commit d472a8d

Please sign in to comment.