feat: add auto-push functionality to commit and tag commands

This commit is contained in:
2026-02-01 12:35:26 +00:00
parent 0cbd975748
commit 09d2b6db8c
6 changed files with 131 additions and 27 deletions

View File

@@ -158,11 +158,22 @@ impl TagCommand {
println!("{} {}", messages.tag_created().green(), tag_name.cyan());
// Push if requested
// Push if requested or ask user
if self.push {
println!("{}", messages.pushing_tag(&self.remote));
repo.push(&self.remote, &format!("refs/tags/{}", tag_name))?;
println!("{}", messages.pushed_tag(&self.remote));
} else if !self.yes && !self.dry_run {
let should_push = Confirm::new()
.with_prompt(messages.push_after_tag())
.default(false)
.interact()?;
if should_push {
println!("{}", messages.pushing_tag(&self.remote));
repo.push(&self.remote, &format!("refs/tags/{}", tag_name))?;
println!("{}", messages.pushed_tag(&self.remote));
}
}
Ok(())