···2084 return
2085 }
20862087- forks, err := db.GetForksByDid(s.db, user.Did)
2088- if err != nil {
2089- s.pages.Notice(w, "compare-error", "Failed to produce comparison. Try again later.")
2090- log.Println("failed to get forks", err)
2091- return
00002092 }
20932094 s.pages.RepoCompare(w, pages.RepoCompareParams{
···2084 return
2085 }
20862087+ var forks []db.Repo
2088+ if user != nil {
2089+ var err error
2090+ forks, err = db.GetForksByDid(s.db, user.Did)
2091+ if err != nil {
2092+ s.pages.Notice(w, "compare-error", "Failed to produce comparison. Try again later.")
2093+ log.Println("failed to get forks", err)
2094+ return
2095+ }
2096 }
20972098 s.pages.RepoCompare(w, pages.RepoCompareParams{
+3-3
knotserver/git/diff.go
···127128// FormatPatch generates a git-format-patch output between two commits,
129// and returns the raw format-patch series, a parsed FormatPatch and an error.
130-func (g *GitRepo) formatSinglePatch(base, commit2 plumbing.Hash, extraArgs ...string) (string, *patchutil.FormatPatch, error) {
131 var stdout bytes.Buffer
132133 args := []string{
···222 return commits, nil
223}
224225-func (g *GitRepo) FormatPatch(base, commit2 *object.Commit) (string, []patchutil.FormatPatch, error) {
226 // get list of commits between commir2 and base
227 commits, err := g.commitsBetween(commit2, base)
228 if err != nil {
···233 slices.Reverse(commits)
234235 var allPatchesContent strings.Builder
236- var allPatches []patchutil.FormatPatch
237238 for _, commit := range commits {
239 changeId := ""
···127128// FormatPatch generates a git-format-patch output between two commits,
129// and returns the raw format-patch series, a parsed FormatPatch and an error.
130+func (g *GitRepo) formatSinglePatch(base, commit2 plumbing.Hash, extraArgs ...string) (string, *types.FormatPatch, error) {
131 var stdout bytes.Buffer
132133 args := []string{
···222 return commits, nil
223}
224225+func (g *GitRepo) FormatPatch(base, commit2 *object.Commit) (string, []types.FormatPatch, error) {
226 // get list of commits between commir2 and base
227 commits, err := g.commitsBetween(commit2, base)
228 if err != nil {
···233 slices.Reverse(commits)
234235 var allPatchesContent strings.Builder
236+ var allPatches []types.FormatPatch
237238 for _, commit := range commits {
239 changeId := ""