index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff

Diffstat (limited to 'src/git/commit.rs')

-rw-r--r-- src/git/commit.rs 11
 1 file changed, 11 insertions(+)

diff --git a/src/git/commit.rs b/src/git/commit.rs
index e446207..a6cd67e 100644
--- a/src/git/commit.rs
+++ b/src/git/commit.rs
@@ -89,6 +89,17 @@
        Ok(None)
    }

    /// Returns the committer timestamp (in seconds) of the repository's latest commit,
    /// or `i64::MIN` if the repository has no commits yet.
    pub fn last_commit_timestamp(&self) -> i64 {
        let gix_repo = self.gix();
        self.last_commit(&gix_repo)
            .ok()
            .flatten()
            .map(|c| c.committer.time.seconds())
            .unwrap_or(i64::MIN)
    }

    pub fn branch_tips_by_commit(&self) -> Result<HashMap<String, Vec<String>>, Error> {
        let gix_repo = self.gix();
        let references = gix_repo.references()?;