From 462f36fe0728a8493b96f1f5419c309d6ef2086f Mon Sep 17 00:00:00 2001 From: Andreas Hartmann Date: Sun, 27 Aug 2023 19:12:51 +0200 Subject: [PATCH] xtask: Prevent accidental git commit deletion when dry-running a publish. --- xtask/src/pipelines.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xtask/src/pipelines.rs b/xtask/src/pipelines.rs index b4e258d6df..4195af7637 100644 --- a/xtask/src/pipelines.rs +++ b/xtask/src/pipelines.rs @@ -395,7 +395,7 @@ pub fn publish(sh: &Shell, flags: flags::Publish) -> anyhow::Result<()> { // program. When dry-running we need to undo the release commit first! let result = closure(); - if flags.dry_run { + if flags.dry_run && !skip_build { cmd!(sh, "git reset --hard HEAD~1") .run() .context(err_context)?;