forked from tangled.org/core
this repo has no description tangled.org

knotserver: remove unused functions

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

authored by handle.invalid and committed by Tangled 8ee5ddca 34e02d1f

Changed files
-37
knotserver
-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 { ··· 160 152 } 161 153 162 154 return buf.Bytes(), nil 163 - } 164 - 165 - func (g *GitRepo) FileContent(path string) (string, error) { 166 - c, err := g.r.CommitObject(g.h) 167 - if err != nil { 168 - return "", fmt.Errorf("commit object: %w", err) 169 - } 170 - 171 - tree, err := c.Tree() 172 - if err != nil { 173 - return "", fmt.Errorf("file tree: %w", err) 174 - } 175 - 176 - file, err := tree.File(path) 177 - if err != nil { 178 - return "", err 179 - } 180 - 181 - isbin, _ := file.IsBinary() 182 - 183 - if !isbin { 184 - return file.Contents() 185 - } else { 186 - return "", ErrBinaryFile 187 - } 188 155 } 189 156 190 157 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 - }