+8
-4
appview/db/issues.go
+8
-4
appview/db/issues.go
···
359
359
repoMap[string(repos[i].RepoAt())] = &repos[i]
360
360
}
361
361
362
-
for issueAt := range issueMap {
363
-
i := issueMap[issueAt]
364
-
r := repoMap[string(i.RepoAt)]
365
-
i.Repo = r
362
+
for issueAt, i := range issueMap {
363
+
if r, ok := repoMap[string(i.RepoAt)]; ok {
364
+
i.Repo = r
365
+
} else {
366
+
// do not show up the issue if the repo is deleted
367
+
// TODO: foreign key where?
368
+
delete(issueMap, issueAt)
369
+
}
366
370
}
367
371
368
372
// collect comments
+2
-2
appview/db/profile.go
+2
-2
appview/db/profile.go
···
553
553
query = `select count(id) from pulls where owner_did = ? and state = ?`
554
554
args = append(args, did, PullOpen)
555
555
case VanityStatOpenIssueCount:
556
-
query = `select count(id) from issues where owner_did = ? and open = 1`
556
+
query = `select count(id) from issues where did = ? and open = 1`
557
557
args = append(args, did)
558
558
case VanityStatClosedIssueCount:
559
-
query = `select count(id) from issues where owner_did = ? and open = 0`
559
+
query = `select count(id) from issues where did = ? and open = 0`
560
560
args = append(args, did)
561
561
case VanityStatRepositoryCount:
562
562
query = `select count(id) from repos where did = ?`
-1
appview/state/profile.go
-1
appview/state/profile.go
+1
knotserver/xrpc/repo_blob.go
+1
knotserver/xrpc/repo_blob.go
+8
-6
knotserver/xrpc/repo_branches.go
+8
-6
knotserver/xrpc/repo_branches.go
···
20
20
21
21
cursor := r.URL.Query().Get("cursor")
22
22
23
-
limit := 50 // default
24
-
if limitStr := r.URL.Query().Get("limit"); limitStr != "" {
25
-
if l, err := strconv.Atoi(limitStr); err == nil && l > 0 && l <= 100 {
26
-
limit = l
27
-
}
28
-
}
23
+
// limit := 50 // default
24
+
// if limitStr := r.URL.Query().Get("limit"); limitStr != "" {
25
+
// if l, err := strconv.Atoi(limitStr); err == nil && l > 0 && l <= 100 {
26
+
// limit = l
27
+
// }
28
+
// }
29
+
30
+
limit := 500
29
31
30
32
gr, err := git.PlainOpen(repoPath)
31
33
if err != nil {