fix(git): add offset_minutes to reflog entry for timezone-correct timestamps

CommitReflogEntry now includes offset_minutes field, populated from
sig.when().offset_minutes() — matches git's internal timezone offset
representation. Used by git_tools for accurate reflog timestamps.
This commit is contained in:
ZhenYi 2026-04-25 09:54:30 +08:00
parent 99bc4eeb80
commit 76de013a60
2 changed files with 3 additions and 0 deletions

View File

@ -121,6 +121,7 @@ impl GitDomain {
committer_name: sig.name().unwrap_or("").to_string(),
committer_email: sig.email().unwrap_or("").to_string(),
time_secs: sig.when().seconds(),
offset_minutes: sig.when().offset_minutes(),
message: entry.message().map(String::from),
ref_name: refname.clone(),
});
@ -207,6 +208,7 @@ impl GitDomain {
committer_name: sig.name().unwrap_or("").to_string(),
committer_email: sig.email().unwrap_or("").to_string(),
time_secs: sig.when().seconds(),
offset_minutes: sig.when().offset_minutes(),
message: entry.message().map(String::from),
ref_name: refname.clone(),
});

View File

@ -145,6 +145,7 @@ pub struct CommitReflogEntry {
pub committer_name: String,
pub committer_email: String,
pub time_secs: i64,
pub offset_minutes: i32,
pub message: Option<String>,
pub ref_name: String,
}