Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

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/releases.go → server/web/releases.go +10−10

@@ -14,8 +14,8 @@ import (
14 14 "strings"
15 15 "time"
16 16
17 "github.com/rodent-software/vole/internal/gitx"
18 "github.com/rodent-software/vole/internal/releases"
17 "github.com/rodent-software/vole/core/git"
18 "github.com/rodent-software/vole/metadata"
19 19 )
20 20
21 21 // archiveConc bounds concurrent compressed archives. Plain tar streams at
@@ -48,7 +48,7 @@ func (w *Web) Releases(rw http.ResponseWriter, r *http.Request) {
48 48 w.render(rw, "releases", struct {
49 49 Page
50 50 Name string
51 Tags []gitx.Tag
51 Tags []git.Tag
52 52 Lightweight int
53 53 }{w.base(m.Name + " · releases"), m.Name, tags, light}, 0)
54 54 }
@@ -80,7 +80,7 @@ func (w *Web) ReleaseView(rw http.ResponseWriter, r *http.Request) {
80 80
81 81 // The artifact list is the pointer directory on the metadata branch, not a
82 82 // stored manifest: the same pointers the sweep marks and the hook validates.
83 artifacts, _ := releases.List(g, t.Name)
83 artifacts, _ := metadata.ListReleaseArtifacts(g, t.Name)
84 84 var artifactBytes int64
85 85 for _, a := range artifacts {
86 86 artifactBytes += a.Size
@@ -102,15 +102,15 @@ func (w *Web) ReleaseView(rw http.ResponseWriter, r *http.Request) {
102 102 w.render(rw, "release", struct {
103 103 Page
104 104 Name string
105 Tag gitx.Tag
105 Tag git.Tag
106 106 Notes template.HTML
107 107 Prev string
108 108 Count int
109 Commits []gitx.Commit
109 Commits []git.Commit
110 110 Capped bool
111 111 CappedAt int
112 112 LFSPointers bool
113 Artifacts []releases.Artifact
113 Artifacts []metadata.Artifact
114 114 ArtifactBytes int64
115 115 }{
116 116 Page: w.base(m.Name + " · " + t.Name),
@@ -144,12 +144,12 @@ func (w *Web) ReleaseArtifact(rw http.ResponseWriter, r *http.Request) {
144 144 return
145 145 }
146 146 name := r.PathValue("artifact")
147 artifacts, err := releases.List(g, t.Name)
147 artifacts, err := metadata.ListReleaseArtifacts(g, t.Name)
148 148 if err != nil {
149 149 http.Error(rw, "vole: cannot read that release", http.StatusInternalServerError)
150 150 return
151 151 }
152 var art *releases.Artifact
152 var art *metadata.Artifact
153 153 for i := range artifacts {
154 154 if artifacts[i].Name == name {
155 155 art = &artifacts[i]
@@ -260,7 +260,7 @@ func (w *Web) releaseArchive(rw http.ResponseWriter, r *http.Request, format str
260 260 // root .gitattributes, which is where `git lfs track` writes its patterns; a
261 261 // pattern declared in a subdirectory is not detected, and the notice is worded so
262 262 // that the omission cannot make it false.
263 func usesLFS(g *gitx.Repo, commit string) bool {
263 func usesLFS(g *git.Repo, commit string) bool {
264 264 data, err := g.BlobAt(commit, ".gitattributes")
265 265 if err != nil {
266 266 return false