Skip to content

Commit 25c07a8

Browse files
author
Stephan Dilly
committed
warn if commit fails (like when no name is set) (#74)
1 parent 28550f7 commit 25c07a8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/commit.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,17 @@ impl CommitComponent {
135135
return;
136136
}
137137

138-
sync::commit(CWD, &self.msg).unwrap();
138+
if let Err(e) = sync::commit(CWD, &self.msg) {
139+
error!("commit error: {}", &e);
140+
self.queue.borrow_mut().push_back(
141+
InternalEvent::ShowMsg(format!(
142+
"commit failed:\n{}",
143+
&e
144+
)),
145+
);
146+
return;
147+
}
148+
139149
if let HookResult::NotOk(e) =
140150
sync::hooks_post_commit(CWD).unwrap()
141151
{

0 commit comments

Comments
 (0)