优化panic

This commit is contained in:
HouXiaoxuan
2023-12-21 01:48:37 +08:00
parent 9feddad8ef
commit 500a1de45c
2 changed files with 2 additions and 2 deletions

View File

@@ -168,7 +168,6 @@ impl Index {
/** 获取跟踪的文件列表 */
pub fn get_tracked_files(&self) -> Vec<PathBuf> {
// XXX 测试版本,有待修改
let mut files = Vec::new();
self.entries.keys().for_each(|file| {
if file.exists() {

View File

@@ -1,3 +1,4 @@
use chrono::format::format;
use sha1::{Digest, Sha1};
use std::io::Write;
use std::path::{Path, PathBuf};
@@ -108,7 +109,7 @@ pub fn get_storage_path() -> Result<PathBuf, io::Error> {
if !current_dir.pop() {
return Err(io::Error::new(
io::ErrorKind::NotFound,
"Not a git repository",
format!("{:?} is not a git repository", std::env::current_dir()?),
));
}
}