xtask: Fix release creating an empty commit on existing release

This commit is contained in:
132ikl 2021-04-24 05:23:09 -04:00 committed by GitHub
parent 12ec0fb168
commit ba642674af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,6 +108,7 @@ impl ReleaseTask {
let mut macros = self.macros();
if self.package.version != self.version {
if let Some(m) = macros.as_mut() {
println!("Found macros crate {}.", m.name);
@ -119,10 +120,18 @@ 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()?;
} else if !ask_yes_no(&format!(
"Package is already version {}. Skip creating a commit and continue?",
&self.version
))? {
return Ok(());
}
if let Some(m) = macros {
let published = m.publish(&self.http_client)?;