forked from tangled.org/core
this repo has no description

Compare changes

Choose any two refs to compare.

Changed files
+21 -16
appview
db
pages
markup
repo
state
knotserver
+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
··· 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 -1
appview/pages/markup/markdown.go
··· 235 235 repoName := fmt.Sprintf("%s/%s", rctx.RepoInfo.OwnerDid, rctx.RepoInfo.Name) 236 236 237 237 query := fmt.Sprintf("repo=%s&ref=%s&path=%s&raw=true", 238 - repoName, url.PathEscape(rctx.RepoInfo.Ref), actualPath) 238 + url.PathEscape(repoName), url.PathEscape(rctx.RepoInfo.Ref), actualPath) 239 239 240 240 parsedURL := &url.URL{ 241 241 Scheme: scheme,
+1 -2
appview/repo/repo.go
··· 11 11 "log/slog" 12 12 "net/http" 13 13 "net/url" 14 - "path" 15 14 "path/filepath" 16 15 "slices" 17 16 "strconv" ··· 710 709 } 711 710 712 711 // fetch the raw binary content using sh.tangled.repo.blob xrpc 713 - repoName := path.Join("%s/%s", f.OwnerDid(), f.Name) 712 + repoName := fmt.Sprintf("%s/%s", f.OwnerDid(), f.Name) 714 713 blobURL := fmt.Sprintf("%s://%s/xrpc/sh.tangled.repo.blob?repo=%s&ref=%s&path=%s&raw=true", 715 714 scheme, f.Knot, url.QueryEscape(repoName), url.QueryEscape(ref), url.QueryEscape(filePath)) 716 715
-1
appview/state/profile.go
··· 17 17 "github.com/gorilla/feeds" 18 18 "tangled.sh/tangled.sh/core/api/tangled" 19 19 "tangled.sh/tangled.sh/core/appview/db" 20 - // "tangled.sh/tangled.sh/core/appview/oauth" 21 20 "tangled.sh/tangled.sh/core/appview/pages" 22 21 ) 23 22
+1
knotserver/xrpc/repo_blob.go
··· 69 69 return 70 70 } 71 71 w.Header().Set("ETag", eTag) 72 + w.Header().Set("Content-Type", mimeType) 72 73 73 74 case strings.HasPrefix(mimeType, "text/"): 74 75 w.Header().Set("Cache-Control", "public, no-cache")
+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 {