Skip to content

Commit 030a32f

Browse files
committed
feat: dry-run flag
1 parent 65e41f5 commit 030a32f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main.rs

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ struct Args {
2323
/// to synchronize itself.
2424
#[arg(short = 'i', long, default_value_t = 2.5)]
2525
push_retry_interval: f64,
26+
27+
/// When set, perform checks but do not actually change the repo state.
28+
#[arg(short, long)]
29+
dry_run: bool,
2630
}
2731

2832
fn ensure_tool(sh: &Shell, tool_name: &str) -> Result<()> {
@@ -143,6 +147,11 @@ fn main() -> Result<()> {
143147
}
144148
}
145149

150+
if args.dry_run {
151+
println!("all checks OK but aborting due to dry run");
152+
return Ok(());
153+
}
154+
146155
// ensure that the branch is at the tip of its base for a linear history
147156
let base = status.base_ref_name;
148157
cmd!(sh, "git fetch").run().context("git fetch")?;

0 commit comments

Comments
 (0)