mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-07-03 01:36:04 +08:00
优化commit第一次提交,parent为空而不是“”
This commit is contained in:
@@ -2,7 +2,7 @@ use std::time::SystemTime;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::store;
|
||||
use crate::{store, utils::util};
|
||||
|
||||
use super::{index::Index, object::Hash, tree::Tree};
|
||||
/*Commit
|
||||
@@ -26,6 +26,9 @@ impl Commit {
|
||||
pub fn get_hash(&self) -> String {
|
||||
self.hash.clone()
|
||||
}
|
||||
pub fn get_date(&self) -> String {
|
||||
util::format_time(&self.date)
|
||||
}
|
||||
pub fn get_tree_hash(&self) -> String {
|
||||
self.tree.clone()
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ impl Tree {
|
||||
.map(|file| util::to_workdir_relative_path(file))
|
||||
.collect();
|
||||
|
||||
store_path_to_tree(&file_entries, "".to_string().into())
|
||||
store_path_to_tree(&file_entries, "".into())
|
||||
}
|
||||
|
||||
pub fn load(hash: &String) -> Tree {
|
||||
|
||||
Reference in New Issue
Block a user