git-preview @ main

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

git: file content at ref
Sun, 11 Dec 2022
1 files changed, 19 insertions(+), 0 deletions(-)
M git/git.go

@@ -64,6 +64,25 @@

return files, nil } +func FileContentAtRef(r *git.Repository, hash plumbing.Hash, path string) (string, error) { + c, err := r.CommitObject(hash) + if err != nil { + return "", fmt.Errorf("commit object: %w", err) + } + + tree, err := c.Tree()

… preview truncated