From 13922afe5ee165dbc7abc32e792e9041406acdc6 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sun, 26 Jan 2025 18:17:18 +0100 Subject: [PATCH] refuse wip commit push --- src/git.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/git.rs b/src/git.rs index 775aa8b..c261286 100644 --- a/src/git.rs +++ b/src/git.rs @@ -36,7 +36,11 @@ pub fn create_new_branch(branch: &str) { /// Push the current repository to remote pub fn push(force: bool) { - // TODO : Refuse push if WIP commit present + if last_commit().as_str() == "WIP" { + println!("{}", "Refusing to push WIP commit".paint(Color::Red)); + std::process::exit(1); + } + let mut cmd = Exec::cmd("git") .arg("push") .arg("--set-upstream")