aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/git
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-08-04 14:44:36 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-08-04 14:44:36 +0200
commit60004cfb97fe0eb64d1c8310e7c9caae96b8adbe (patch)
tree2267cf703f6870b05d68c73be7af1fc57190e770 /pkg/handler/git
parentaa559681fcf8df993029370f28e0011315ca8761 (diff)
downloadcerrado-60004cfb97fe0eb64d1c8310e7c9caae96b8adbe.tar.gz
cerrado-60004cfb97fe0eb64d1c8310e7c9caae96b8adbe.tar.bz2
cerrado-60004cfb97fe0eb64d1c8310e7c9caae96b8adbe.zip
feat: Add diff view
Adds a very simple diff view for a commit
Diffstat (limited to 'pkg/handler/git')
-rw-r--r--pkg/handler/git/handler.go6
1 files changed, 6 insertions, 0 deletions
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)