xtask: Fix wrong release version comparison

self.package.version was compared to self.version after being set to the same.
This commit is contained in:
Jonas Platte 2021-05-15 19:25:43 +02:00
parent 3ec830271c
commit 1e079a4fe3
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -108,7 +108,7 @@ impl ReleaseTask {
let mut macros = self.macros();
if self.package.version != self.version {
let create_commit = if self.package.version != self.version {
if let Some(m) = macros.as_mut() {
println!("Found macros crate {}.", m.name);
@ -120,17 +120,20 @@ impl ReleaseTask {
self.package.update_version(&self.version)?;
self.package.update_dependants(&self.metadata)?;
}
let changes = &self.package.changes(!prerelease)?;
if self.package.version != self.version {
self.commit()?;
true
} else if !ask_yes_no(&format!(
"Package is already version {}. Skip creating a commit and continue?",
&self.version
))? {
return Ok(());
} else {
false
};
let changes = &self.package.changes(!prerelease)?;
if create_commit {
self.commit()?;
}
if let Some(m) = macros {