git-preview @ main

static git web frontend but with images and html previews + code truncation

git: fix trees
Sun, 11 Dec 2022
2 files changed, 97 insertions(+), 59 deletions(-)
M git/git.go

@@ -8,64 +8,52 @@ "github.com/go-git/go-git/v5/plumbing"

"github.com/go-git/go-git/v5/plumbing/object" ) -func AllCommits(r *git.Repository) ([]*object.Commit, error) { - ci, err := r.Log(&git.LogOptions{All: true}) - if err != nil { - return nil, fmt.Errorf("all commits: %w", err) - } - - commits := []*object.Commit{}

… preview truncated

A git/tree.go

@@ -0,0 +1,64 @@

+package git + +import ( + "fmt" + + "github.com/go-git/go-git/v5/plumbing/object" +) + +func (g *GitRepo) FileTree(path string) ([]NiceTree, error) { + c, err := g.r.CommitObject(g.h)

… preview truncated