mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-04-01 18:00:24 +08:00
Revert "setup_test_with_clean_mit() 会清理文件"
This reverts commit 13aa7452de.
This commit is contained in:
@@ -71,6 +71,7 @@ impl Store {
|
||||
let mut path = self.store_path.clone();
|
||||
path.push("objects");
|
||||
path.push(&hash);
|
||||
println!("Saved to: [{}]", path.display());
|
||||
match std::fs::write(path, content) {
|
||||
Ok(_) => hash,
|
||||
Err(_) => panic!("储存库疑似损坏,无法写入文件"),
|
||||
|
||||
@@ -52,9 +52,6 @@ pub fn setup_test_with_mit() {
|
||||
pub fn setup_test_with_clean_mit() {
|
||||
setup_test_without_mit();
|
||||
let _ = crate::commands::init::init();
|
||||
list_workdir_files().iter().for_each(|path| {
|
||||
fs::remove_file(path).unwrap();
|
||||
});
|
||||
}
|
||||
|
||||
pub fn setup_test_without_mit() {
|
||||
@@ -80,13 +77,6 @@ pub fn ensure_test_file(path: &Path, content: option::Option<&str>) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ensure_no_file(path: &Path) {
|
||||
// 以测试目录为根目录,删除文件
|
||||
if path.exists() {
|
||||
fs::remove_file(get_working_dir().unwrap().join(path)).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
/* tools for mit */
|
||||
pub fn calc_hash(data: &String) -> String {
|
||||
let mut hasher = Sha1::new();
|
||||
|
||||
Reference in New Issue
Block a user