all repos — legit @ 01f27147baf80e2222927ddca9369c7d99b4ff3c

web frontend for git, written in go

routes: index view

commit

01f27147baf80e2222927ddca9369c7d99b4ff3c

parent

82b8afe19b77fe02e1a29a5b5e20882d8e5c3fc5

1 file changed, 8 insertions(+), 0 deletions(-)

changed files
M git/git.gogit/git.go
@@ -52,6 +52,14 @@
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 {