diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-02-15 17:33:24 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-02-15 17:33:24 +0100 |
commit | 27400b0fce5d4ef3b7fd5ef4d25bac8f00754e33 (patch) | |
tree | b1e4df482d7c78e1d7fc56e862b7c266ba2b8e8b /pkg/handler/git/handler.go | |
parent | 4708ad8ffd96f3b457ff9d3a9660e7d0aa59a4b1 (diff) | |
download | cerrado-27400b0fce5d4ef3b7fd5ef4d25bac8f00754e33.tar.gz cerrado-27400b0fce5d4ef3b7fd5ef4d25bac8f00754e33.tar.bz2 cerrado-27400b0fce5d4ef3b7fd5ef4d25bac8f00754e33.zip |
feat: Add wrapper for commit
Add a wrapper to the commit log that also contains possible reference.
This will be useful once to later display the reference in the commit
log.
Diffstat (limited to 'pkg/handler/git/handler.go')
-rw-r--r-- | pkg/handler/git/handler.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/handler/git/handler.go b/pkg/handler/git/handler.go index 80f7de6..33adc8d 100644 --- a/pkg/handler/git/handler.go +++ b/pkg/handler/git/handler.go @@ -384,7 +384,7 @@ func (g *GitHandler) Commit(w http.ResponseWriter, r *http.Request) error { Name: name, Ref: ref, GitItemBase: &templates.GitItemCommitPage{ - Commit: commit, + Commit: commit.Commit(), Diff: code.Bytes(), }, } @@ -425,11 +425,11 @@ func orderBy(repos []*service.Repository, order config.OrderBy) []*service.Repos }) case config.LastCommitAsc: sort.Slice(repos, func(i, j int) bool { - return repos[i].LastCommit.Committer.When.Before(repos[j].LastCommit.Committer.When) + return repos[i].LastCommit.Commit().Committer.When.Before(repos[j].LastCommit.Commit().Committer.When) }) case config.LastCommitDesc: sort.Slice(repos, func(i, j int) bool { - return repos[i].LastCommit.Committer.When.After(repos[j].LastCommit.Committer.When) + return repos[i].LastCommit.Commit().Committer.When.After(repos[j].LastCommit.Commit().Committer.When) }) } |