diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-12 21:33:09 +0530 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-12 21:33:09 +0530 |
commit | 01f27147baf80e2222927ddca9369c7d99b4ff3c (patch) | |
tree | ffd8f1431f83ae4f1b390c907ee45c377c84f436 /git/git.go | |
parent | 82b8afe19b77fe02e1a29a5b5e20882d8e5c3fc5 (diff) | |
download | legit-01f27147baf80e2222927ddca9369c7d99b4ff3c.tar.gz legit-01f27147baf80e2222927ddca9369c7d99b4ff3c.tar.bz2 legit-01f27147baf80e2222927ddca9369c7d99b4ff3c.zip |
routes: index view
Diffstat (limited to 'git/git.go')
-rw-r--r-- | git/git.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -52,6 +52,14 @@ func (g *GitRepo) Commits() ([]*object.Commit, error) { return commits, nil } +func (g *GitRepo) LastCommit() (*object.Commit, error) { + c, err := g.r.CommitObject(g.h) + if err != nil { + return nil, fmt.Errorf("last commit: %w", err) + } + return c, nil +} + func (g *GitRepo) FileContent(path string) (string, error) { c, err := g.r.CommitObject(g.h) if err != nil { |