aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-18 20:12:32 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-18 20:12:32 +0800
commitd1a1358c447175bdfd2c44f0baf2f53201ed096a (patch)
tree01c05bcab641654b21b7ff9a09ebf03df49aaa03 /http_handle_repo_index.go
parentRemove underscores from Go code, pt 1 (diff)
downloadforge-d1a1358c447175bdfd2c44f0baf2f53201ed096a.tar.gz
forge-d1a1358c447175bdfd2c44f0baf2f53201ed096a.tar.zst
forge-d1a1358c447175bdfd2c44f0baf2f53201ed096a.zip
gofumpt
Diffstat (limited to '')
-rw-r--r--http_handle_repo_index.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go
index e4a9f5d..da06500 100644
--- a/http_handle_repo_index.go
+++ b/http_handle_repo_index.go
@@ -9,8 +9,8 @@ import (
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
- "github.com/go-git/go-git/v5/plumbing/storer"
"github.com/go-git/go-git/v5/plumbing/object"
+ "github.com/go-git/go-git/v5/plumbing/storer"
)
func handle_repo_index(w http.ResponseWriter, r *http.Request, params map[string]any) {
@@ -38,12 +38,14 @@ func handle_repo_index(w http.ResponseWriter, r *http.Request, params map[string
}
branches_, err = repo.Branches()
- if err != nil {}
- err = branches_.ForEach(func (branch *plumbing.Reference) error {
+ if err != nil {
+ }
+ err = branches_.ForEach(func(branch *plumbing.Reference) error {
branches = append(branches, branch.Name().Short())
return nil
})
- if err != nil {}
+ if err != nil {
+ }
params["branches"] = branches
if recent_commits, err = get_recent_commits(repo, ref_hash, 3); err != nil {