all repos — elgit @ 8f562b78446b9fb5bfc73a6f41788647a3779189

fork of legit: web frontend for git, written in go

update repository list on timer instead of generating per request

Alan Pearce
commit

8f562b78446b9fb5bfc73a6f41788647a3779189

parent

975625f9d4d26eb56f4428f2921b9e1090a49621

1 file changed, 4 insertions(+), 4 deletions(-)

changed files
M routes/util.goroutes/util.go
@@ -4,6 +4,7 @@ import (
"bufio" "log" "os" + "path" "path/filepath" "slices" "strings"
@@ -11,7 +12,6 @@
"alin.ovh/elgit/data" "alin.ovh/elgit/git" securejoin "github.com/cyphar/filepath-securejoin" - "github.com/dimfeld/httptreemux/v5" "github.com/savsgio/atreugo/v11" )
@@ -47,7 +47,7 @@
func (d *deps) GetCleanPath(name string) (string, error) { return securejoin.SecureJoin( filepath.Join(d.c.Repo.Root, "repositories"), - httptreemux.Clean(name)+".git", + path.Clean(name)+".git", ) }
@@ -71,7 +71,7 @@
return projects, nil } -func (d *deps) getAllRepos() *data.Entries { +func (d *deps) UpdateRepos() { entries := &data.Entries{ Children: []*data.Entry{}, Map: map[string]*data.Entry{},
@@ -111,7 +111,7 @@ }
entries.Sort() - return entries + d.repos = entries } func setContentDisposition(rc *atreugo.RequestCtx, name string) {