vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
refactor
c5902451905acdaa478f8476844ccd4a510d9ca9 · Keenan Nemetz · 17d ago · parent ec2aba4b
internal/web/issues.go → server/web/issues.go +10−9
| @@ -12,10 +12,11 @@ import ( | |||
| 12 | 12 | "github.com/yuin/goldmark" | |
| 13 | 13 | "github.com/yuin/goldmark/extension" | |
| 14 | 14 | ||
| 15 | "github.com/rodent-software/vole/internal/gitx" | ||
| 16 | "github.com/rodent-software/vole/internal/index" | ||
| 17 | "github.com/rodent-software/vole/internal/issues" | ||
| 18 | "github.com/rodent-software/vole/internal/repo" | ||
| 15 | "github.com/rodent-software/vole/core/git" | ||
| 16 | voleid "github.com/rodent-software/vole/core/id" | ||
| 17 | "github.com/rodent-software/vole/forge/index" | ||
| 18 | "github.com/rodent-software/vole/forge/repo" | ||
| 19 | "github.com/rodent-software/vole/metadata" | ||
| 19 | 20 | ) | |
| 20 | 21 | ||
| 21 | 22 | var ( | |
| @@ -136,7 +137,7 @@ func (w *Web) IssueView(rw http.ResponseWriter, r *http.Request) { | |||
| 136 | 137 | return | |
| 137 | 138 | } | |
| 138 | 139 | id := r.PathValue("id") | |
| 139 | if !issues.ValidULID(id) { | ||
| 140 | if !voleid.Valid(id) { | ||
| 140 | 141 | http.NotFound(rw, r) | |
| 141 | 142 | return | |
| 142 | 143 | } | |
| @@ -146,7 +147,7 @@ func (w *Web) IssueView(rw http.ResponseWriter, r *http.Request) { | |||
| 146 | 147 | return | |
| 147 | 148 | } | |
| 148 | 149 | type rendered struct { | |
| 149 | issues.Comment | ||
| 150 | metadata.Comment | ||
| 150 | 151 | Body template.HTML | |
| 151 | 152 | } | |
| 152 | 153 | comments := make([]rendered, 0, len(iss.Comments)) | |
| @@ -156,11 +157,11 @@ func (w *Web) IssueView(rw http.ResponseWriter, r *http.Request) { | |||
| 156 | 157 | w.render(rw, "issue", struct { | |
| 157 | 158 | Page | |
| 158 | 159 | Name string | |
| 159 | Issue *issues.Issue | ||
| 160 | Issue *metadata.Issue | ||
| 160 | 161 | Description template.HTML | |
| 161 | 162 | Comments []rendered | |
| 162 | 163 | Labels string | |
| 163 | Backlinks []gitx.Commit | ||
| 164 | Backlinks []git.Commit | ||
| 164 | 165 | }{ | |
| 165 | 166 | Page: w.base(m.Name + " · " + iss.Title), | |
| 166 | 167 | Name: m.Name, | |
| @@ -174,7 +175,7 @@ func (w *Web) IssueView(rw http.ResponseWriter, r *http.Request) { | |||
| 174 | 175 | ||
| 175 | 176 | // backlinks finds commits whose message mentions the issue. git does the search, | |
| 176 | 177 | // so there is no second index to keep in sync. | |
| 177 | func (w *Web) backlinks(m *repo.Meta, id string) []gitx.Commit { | ||
| 178 | func (w *Web) backlinks(m *repo.Meta, id string) []git.Commit { | ||
| 178 | 179 | if m.DefaultBranch == "" { | |
| 179 | 180 | return nil | |
| 180 | 181 | } | |