From 8ee5ddca8fec08c23d3e7cb4cedd4886798ae9e2 Mon Sep 17 00:00:00 2001 From: noClaps Date: Fri, 26 Sep 2025 08:47:16 +0000 Subject: [PATCH] knotserver: remove unused functions Signed-off-by: noClaps --- knotserver/http_util.go | 4 ---- knotserver/git/git.go | 33 --------------------------------- 2 file(s) changed, 0 insertion(s)(+), 37 deletion(s)(-) diff --git a/knotserver/http_util.go b/knotserver/http_util.go --- a/knotserver/http_util.go +++ b/knotserver/http_util.go @@ -16,7 +16,3 @@ w.WriteHeader(status) json.NewEncoder(w).Encode(map[string]string{"error": msg}) } - -func notFound(w http.ResponseWriter) { - writeError(w, "not found", http.StatusNotFound) -} diff --git a/knotserver/git/git.go b/knotserver/git/git.go --- a/knotserver/git/git.go +++ b/knotserver/git/git.go @@ -120,14 +120,6 @@ return g.r.CommitObject(h) } -func (g *GitRepo) LastCommit() (*object.Commit, error) { - c, err := g.r.CommitObject(g.h) - if err != nil { - return nil, fmt.Errorf("last commit: %w", err) - } - return c, nil -} - func (g *GitRepo) FileContentN(path string, cap int64) ([]byte, error) { c, err := g.r.CommitObject(g.h) if err != nil { @@ -160,31 +152,6 @@ } return buf.Bytes(), nil -} - -func (g *GitRepo) FileContent(path string) (string, error) { - c, err := g.r.CommitObject(g.h) - if err != nil { - return "", fmt.Errorf("commit object: %w", err) - } - - tree, err := c.Tree() - if err != nil { - return "", fmt.Errorf("file tree: %w", err) - } - - file, err := tree.File(path) - if err != nil { - return "", err - } - - isbin, _ := file.IsBinary() - - if !isbin { - return file.Contents() - } else { - return "", ErrBinaryFile - } } func (g *GitRepo) RawContent(path string) ([]byte, error) { -- tangled.sh