mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-04-05 03:38:51 +08:00
todo
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use super::object::Hash;
|
||||
use super::{index::Index, object::Hash};
|
||||
/*Commit
|
||||
* git中版本控制的单位。
|
||||
* 一份Commit中对应一份版Tree,记录了该版本所包含的文件;parent记录本次commit的来源,形成了版本树;
|
||||
@@ -13,3 +13,17 @@ pub struct Commit {
|
||||
parent: Vec<Hash>, // parents commit hash
|
||||
tree: String, // tree hash
|
||||
}
|
||||
|
||||
impl Commit {
|
||||
pub fn new(index: &Index, parent: Vec<Hash>, message: String) -> Commit {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub fn load(hash: &String) -> Commit {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub fn save(&self) {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use super::object::Hash;
|
||||
use super::{index::Index, object::Hash};
|
||||
/*Tree
|
||||
* Tree是一个版本中所有文件的集合。从根目录还是,每个目录是一个Tree,每个文件是一个Blob。Tree之间互相嵌套表示文件的层级关系。
|
||||
* 每一个Tree对象也是对应到git储存仓库的一个文件,其内容是一个或多个TreeEntry。
|
||||
@@ -15,3 +15,17 @@ pub struct Tree {
|
||||
pub hash: Hash,
|
||||
pub entries: Vec<TreeEntry>,
|
||||
}
|
||||
|
||||
impl Tree {
|
||||
pub fn new(index: &Index) -> Tree {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub fn load(hash: &String) -> Tree {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub fn save(&self) {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user