Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

knotserver: remove unused functions

Signed-off-by: noClaps <git@zerolimits.dev>

authored by

noClaps and committed by
Tangled
8ee5ddca 34e02d1f

-37
-33
knotserver/git/git.go
··· 120 120 return g.r.CommitObject(h) 121 121 } 122 122 123 - func (g *GitRepo) LastCommit() (*object.Commit, error) { 124 - c, err := g.r.CommitObject(g.h) 125 - if err != nil { 126 - return nil, fmt.Errorf("last commit: %w", err) 127 - } 128 - return c, nil 129 - } 130 - 131 123 func (g *GitRepo) FileContentN(path string, cap int64) ([]byte, error) { 132 124 c, err := g.r.CommitObject(g.h) 133 125 if err != nil { ··· 152 160 } 153 161 154 162 return buf.Bytes(), nil 155 - } 156 - 157 - func (g *GitRepo) FileContent(path string) (string, error) { 158 - c, err := g.r.CommitObject(g.h) 159 - if err != nil { 160 - return "", fmt.Errorf("commit object: %w", err) 161 - } 162 - 163 - tree, err := c.Tree() 164 - if err != nil { 165 - return "", fmt.Errorf("file tree: %w", err) 166 - } 167 - 168 - file, err := tree.File(path) 169 - if err != nil { 170 - return "", err 171 - } 172 - 173 - isbin, _ := file.IsBinary() 174 - 175 - if !isbin { 176 - return file.Contents() 177 - } else { 178 - return "", ErrBinaryFile 179 - } 180 163 } 181 164 182 165 func (g *GitRepo) RawContent(path string) ([]byte, error) {
-4
knotserver/http_util.go
··· 16 16 w.WriteHeader(status) 17 17 json.NewEncoder(w).Encode(map[string]string{"error": msg}) 18 18 } 19 - 20 - func notFound(w http.ResponseWriter) { 21 - writeError(w, "not found", http.StatusNotFound) 22 - }