fix: 用status重构add,正确处理文件夹中被删除的文件

This commit is contained in:
mrbeanc
2023-12-24 13:23:07 +08:00
parent 7015c9b90a
commit 465047b3ea
3 changed files with 38 additions and 58 deletions

View File

@@ -5,7 +5,6 @@ use crate::{
utils::{util, util::check_repo_exist},
};
use colored::Colorize;
use std::env;
use std::path::PathBuf;
/** 获取需要commit的更改(staged)
@@ -139,7 +138,6 @@ pub fn changes_to_be_staged() -> Changes {
*/
pub fn status() {
check_repo_exist();
//TODO: 输出文件与当前所在目录有关 输出时过滤
match head::current_head() {
Head::Detached(commit) => {
println!("HEAD detached at {}", commit[0..7].to_string());