mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-02-07 20:34:10 +08:00
优化panic
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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()?),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user