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/branch.rs')

-rw-r--r-- src/git/branch.rs 9
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/git/branch.rs b/src/git/branch.rs
index 4b42e47..a23f9a5 100644
--- a/src/git/branch.rs
+++ b/src/git/branch.rs
@@ -12,12 +12,15 @@
impl<'repo> Branch<'repo> {
    pub fn from_gix(mut reference: Reference<'repo>) -> Result<Branch<'repo>, Error> {
        let commit = reference.peel_to_commit()?;
        let author = GitSignature::from_gix(commit.author()?);
        let time = Time::new(commit.time()?);
        let last_commit = Commit::from_gix(commit)?;

        Ok(Branch {
            name: reference.name().shorten().to_string(),
            last_commit: Commit::from_gix(commit.clone())?,
            author: GitSignature::from_gix(commit.author()?),
            time: Time::new(commit.time()?),
            last_commit,
            author,
            time,
            gix: reference,
        })
    }