实现一些数据结构

This commit is contained in:
HouXiaoxuan
2023-12-16 21:40:35 +08:00
parent 2df0375e2e
commit 6f706cd32f
3 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
use super::object::Hash;
/*Commit
* git中版本控制的单位。
* 一份Commit中对应一份版Tree记录了该版本所包含的文件parent记录本次commit的来源形成了版本树
* 此外Commit中还包含了作者、提交者、提交信息等。
*/
#[derive(Debug, Clone)]
pub struct Commit {
hash: Hash,
author: String, // unimplemented ignore
committer: String, // unimplemented ignore
message: String,
parent: Vec<Hash>, // parents commit hash
tree: String, // tree hash
}