fix git::git_log_oldest_timestamp() when there are multiple log entries
This commit is contained in:
parent
1fa3aae2c0
commit
92adb554a5
1 changed files with 3 additions and 1 deletions
|
|
@ -191,6 +191,7 @@ pub fn git_log_oldest_timestamp(
|
|||
.args([
|
||||
"log",
|
||||
"--pretty=format:%at",
|
||||
"--",
|
||||
&path.file_name().unwrap().to_string_lossy(),
|
||||
])
|
||||
.current_dir(&git_dir)
|
||||
|
|
@ -201,7 +202,8 @@ pub fn git_log_oldest_timestamp(
|
|||
return Err(GitError::Oops);
|
||||
}
|
||||
let timestamp_str = std::str::from_utf8(&result.stdout).unwrap();
|
||||
let timestamp_i64 = timestamp_str.parse::<i64>()?;
|
||||
let timestamp_last = timestamp_str.split("\n").last().unwrap();
|
||||
let timestamp_i64 = timestamp_last.parse::<i64>()?;
|
||||
let timestamp = chrono::DateTime::from_timestamp(timestamp_i64, 0)
|
||||
.unwrap()
|
||||
.with_timezone(&chrono::Local);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue