From 83f3f3890c5c13a05b5eb89b76582b5b721863b2 Mon Sep 17 00:00:00 2001 From: HouXiaoxuan Date: Thu, 21 Dec 2023 21:08:04 +0800 Subject: [PATCH] =?UTF-8?q?commit=20=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/commit.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/models/commit.rs b/src/models/commit.rs index 38ec585..154d4ea 100644 --- a/src/models/commit.rs +++ b/src/models/commit.rs @@ -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,