···
securejoin "github.com/cyphar/filepath-securejoin"
"github.com/gliderlabs/ssh"
···
-
commits, err := gr.Commits(0, 60) // a good preview of commits in this repo
-
writeError(w, err.Error(), http.StatusInternalServerError)
-
l.Error("fetching commits", "error", err.Error())
-
total, err := gr.TotalCommits()
-
writeError(w, err.Error(), http.StatusInternalServerError)
-
l.Error("fetching commits", "error", err.Error())
-
branches, err := gr.Branches()
-
l.Error("getting branches", "error", err.Error())
writeError(w, err.Error(), http.StatusInternalServerError)
-
// Non-fatal, we *should* have at least one branch to show.
-
l.Warn("getting tags", "error", err.Error())
rtags := []*types.TagReference{}
···
readmeContent = string(content)
-
files, err := gr.FileTree(r.Context(), "")
-
writeError(w, err.Error(), http.StatusInternalServerError)
-
l.Error("file tree", "error", err.Error())
···
securejoin "github.com/cyphar/filepath-securejoin"
"github.com/gliderlabs/ssh"
···
+
commits []*object.Commit
+
branches []types.Branch
+
tags []*git.TagReference
+
errorsCh := make(chan error, 5)
+
cs, err := gr.Commits(0, 60)
+
errorsCh <- fmt.Errorf("commits: %w", err)
+
t, err := gr.TotalCommits()
+
errorsCh <- fmt.Errorf("calculating total: %w", err)
+
bs, err := gr.Branches()
+
errorsCh <- fmt.Errorf("fetching branches: %w", err)
+
errorsCh <- fmt.Errorf("fetching tags: %w", err)
+
fs, err := gr.FileTree(r.Context(), "")
+
errorsCh <- fmt.Errorf("fetching filetree: %w", err)
+
for err := range errorsCh {
+
l.Error("loading repo", "error", err.Error())
writeError(w, err.Error(), http.StatusInternalServerError)
rtags := []*types.TagReference{}
···
readmeContent = string(content)