From 60004cfb97fe0eb64d1c8310e7c9caae96b8adbe Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 4 Aug 2024 14:44:36 +0200 Subject: feat: Add diff view Adds a very simple diff view for a commit --- pkg/handler/git/handler.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg/handler/git') diff --git a/pkg/handler/git/handler.go b/pkg/handler/git/handler.go index 2ddc5f1..40fae24 100644 --- a/pkg/handler/git/handler.go +++ b/pkg/handler/git/handler.go @@ -340,11 +340,17 @@ func (g *GitHandler) Commit(w http.ResponseWriter, r *http.Request) error { return err } + diff, err := g.gitService.Diff(name, ref) + if err != nil { + return err + } + gitList := &templates.GitItemPage{ Name: name, Ref: ref, GitItemBase: &templates.GitItemCommitPage{ Commit: commit, + Diff: diff, }, } templates.WritePageTemplate(w, gitList) -- cgit v1.2.3