mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-03-24 05:51:16 +08:00
commit 增加时间戳
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::time::SystemTime;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::store;
|
||||
@@ -12,6 +14,7 @@ use super::{index::Index, object::Hash, tree::Tree};
|
||||
pub struct Commit {
|
||||
#[serde(skip)]
|
||||
hash: Hash,
|
||||
date: SystemTime,
|
||||
author: String, // unimplemented ignore
|
||||
committer: String, // unimplemented ignore
|
||||
message: String,
|
||||
@@ -47,6 +50,7 @@ impl Commit {
|
||||
let tree_hash = tree.save();
|
||||
Commit {
|
||||
hash: "".to_string(),
|
||||
date: SystemTime::now(),
|
||||
author: "mit".to_string(),
|
||||
committer: "mit-author".to_string(),
|
||||
message,
|
||||
|
||||
Reference in New Issue
Block a user