diff --git a/src/components/commit.rs b/src/components/commit.rs index afb0251c..64e1c507 100644 --- a/src/components/commit.rs +++ b/src/components/commit.rs @@ -135,7 +135,17 @@ impl CommitComponent { return; } - sync::commit(CWD, &self.msg).unwrap(); + if let Err(e) = sync::commit(CWD, &self.msg) { + error!("commit error: {}", &e); + self.queue.borrow_mut().push_back( + InternalEvent::ShowMsg(format!( + "commit failed:\n{}", + &e + )), + ); + return; + } + if let HookResult::NotOk(e) = sync::hooks_post_commit(CWD).unwrap() {