From af194c3c2c67db881af94609cd5b3a410dfd37eb Mon Sep 17 00:00:00 2001 From: HouXiaoxuan Date: Thu, 21 Dec 2023 19:20:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/add.rs | 5 ++++- src/commands/status.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/commands/add.rs b/src/commands/add.rs index f9598ed..f009c2c 100644 --- a/src/commands/add.rs +++ b/src/commands/add.rs @@ -25,10 +25,13 @@ pub fn add(files: Vec, all: bool, mut update: bool) { let path = if all || update { println!("{}", "--all || --update 运行于工作区目录".bright_green()); get_working_dir().unwrap() - } else { + } else if dot { println!("{}", "'.'代表了当前目录".bright_green()); env::current_dir().unwrap() + } else { + panic!("不应该运行到这里"); }; + println!("Working on [{}]\n", path.to_str().unwrap().bright_blue()); files = list_files(&path).unwrap(); if update { diff --git a/src/commands/status.rs b/src/commands/status.rs index 8f80af4..5c4d6b4 100644 --- a/src/commands/status.rs +++ b/src/commands/status.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use crate::utils::util::to_workdir_absolute_path; use crate::{ head, - models::{blob, commit, index}, + models::{commit, index}, utils::util, };