back interdiff of round #1 and #0

appview: Update New PR Page #490

The compare forks option dropdown now shows repos in which you are a collaborator on instead of just repos you own.

files
appview
db
pages
templates
repo
pulls
pulls
ERROR
appview/db/repos.go

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/pulls/fragments/pullCompareForks.html

Failed to calculate interdiff for this file.

NEW
appview/pulls/pulls.go
···
}
func (s *Pulls) handleForkBasedPull(w http.ResponseWriter, r *http.Request, f *reporesolver.ResolvedRepo, user *oauth.User, forkRepo string, title, body, targetBranch, sourceBranch string, isStacked bool) {
-
fork, err := db.GetForkByDid(s.db, user.Did, forkRepo)
if errors.Is(err, sql.ErrNoRows) {
s.pages.Notice(w, "pull", "No such fork.")
return
···
}
forkVal := r.URL.Query().Get("fork")
-
// fork repo
-
repo, err := db.GetRepo(s.db, user.Did, forkVal)
if err != nil {
log.Println("failed to get repo", user.Did, forkVal)
return
···
}
func (s *Pulls) handleForkBasedPull(w http.ResponseWriter, r *http.Request, f *reporesolver.ResolvedRepo, user *oauth.User, forkRepo string, title, body, targetBranch, sourceBranch string, isStacked bool) {
+
splits := strings.SplitN(forkRepo, "/", 2)
+
fork, err := db.GetForkByDid(s.db, splits[0], splits[1])
if errors.Is(err, sql.ErrNoRows) {
s.pages.Notice(w, "pull", "No such fork.")
return
···
}
forkVal := r.URL.Query().Get("fork")
+
split := strings.SplitN(forkVal, "/", 2)
// fork repo
+
repo, err := db.GetRepo(s.db, split[0], split[1])
if err != nil {
log.Println("failed to get repo", user.Did, forkVal)
return