mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-03-30 17:00:18 +08:00
fix:去除current_head()返回值中的\n
\n会导致文件写入失败
This commit is contained in:
@@ -3,13 +3,13 @@ use crate::models::{commit, index};
|
||||
|
||||
use super::status;
|
||||
|
||||
fn no_change() -> bool {
|
||||
fn no_change() -> bool { //todo: move to status.rs
|
||||
let change = status::changes_to_be_committed();
|
||||
change.new.len() == 0 && change.modified.len() == 0 && change.deleted.len() == 0
|
||||
}
|
||||
pub fn commit(message: String, allow_enpty: bool) {
|
||||
pub fn commit(message: String, allow_empty: bool) {
|
||||
let index = index::Index::new();
|
||||
if no_change() && !allow_enpty {
|
||||
if no_change() && !allow_empty {
|
||||
panic!("工作区没有任何改动,不需要提交");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user