Skip to main content

get_last_commit_time

Function get_last_commit_time 

Source
pub fn get_last_commit_time(repo_path: &Path) -> Result<Option<SystemTime>>
Expand description

Get the timestamp of the most recent commit in a repository.

Returns None if the repo has no commits. git log on an unborn HEAD exits non-zero — but so does git refusing the repository outright (dubious ownership, corruption), and “could not read the history” must not feed the idle check the same answer as “there is no history”: the first is an error, the second makes an empty repo eligible. A rev-parse probe tells the two apart.