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/index/issues.go → forge/index/issues.go +7−12

@@ -1,20 +1,18 @@
1 1 package index
2 2
3 3 import (
4 "encoding/json"
5 4 "strings"
6 5 "time"
7 6
8 "github.com/rodent-software/vole/internal/gitx"
9 "github.com/rodent-software/vole/internal/issues"
10 "github.com/rodent-software/vole/internal/repo"
7 "github.com/rodent-software/vole/forge/repo"
8 "github.com/rodent-software/vole/metadata"
11 9 )
12 10
13 11 // EnsureIssues refreshes a repo's indexed issues if the issues branch moved.
14 12 // Called on read, so a push is visible without a hook or a full rebuild.
15 13 func (s *Store) EnsureIssues(m *repo.Meta) error {
16 14 current := ""
17 if sha, err := m.Git().RevParse(issues.Ref); err == nil {
15 if sha, err := m.Git().RevParse(metadata.Ref); err == nil {
18 16 current = sha
19 17 }
20 18 var stored string
@@ -30,11 +28,11 @@ func (s *Store) EnsureIssues(m *repo.Meta) error {
30 28
31 29 // IndexIssues replaces a repo's issue rows from the issues branch.
32 30 func (s *Store) IndexIssues(m *repo.Meta) error {
33 list, err := issues.Load(m.Git(), issues.Ref)
31 list, err := metadata.LoadIssues(m.Git(), metadata.Ref)
34 32 if err != nil {
35 33 return err
36 34 }
37 sha, err := m.Git().RevParse(issues.Ref)
35 sha, err := m.Git().RevParse(metadata.Ref)
38 36 if err != nil {
39 37 return err
40 38 }
@@ -150,8 +148,8 @@ func (s *Store) Issues(repoID string, f Filter) ([]IssueRow, error) {
150 148
151 149 // LoadIssue reads one issue straight from git, so the rendered body and comments
152 150 // are always the committed ones.
153 func LoadIssue(m *repo.Meta, id string) (*issues.Issue, error) {
154 list, err := issues.Load(m.Git(), issues.Ref)
151 func LoadIssue(m *repo.Meta, id string) (*metadata.Issue, error) {
152 list, err := metadata.LoadIssues(m.Git(), metadata.Ref)
155 153 if err != nil {
156 154 return nil, err
157 155 }
@@ -213,6 +211,3 @@ func (s *Store) IssueCount(repoID string) (int, error) {
213 211 err := s.db.QueryRow(`SELECT COUNT(*) FROM issues WHERE repo_id=?`, repoID).Scan(&n)
214 212 return n, err
215 213 }
216
217 var _ = json.Marshal
218 var _ = gitx.ZeroSHA