loadContent fetches the raw file bytes when the Contents API did not return them inline. The API only omits inline content for large files, which it marks with a "none" encoding; everything else (including empty files) comes back base64-encoded, so there is nothing to fetch.
(httpClient *http.Client, repo ghrepo.Interface, file *repoFile, ref string)
| 214 | // The API only omits inline content for large files, which it marks with a "none" encoding; |
| 215 | // everything else (including empty files) comes back base64-encoded, so there is nothing to fetch. |
| 216 | func loadContent(httpClient *http.Client, repo ghrepo.Interface, file *repoFile, ref string) error { |
| 217 | if file.Encoding != "none" { |
| 218 | return nil |
| 219 | } |
| 220 | |
| 221 | raw, err := fetchRawFile(httpClient, repo, file.Path, ref) |
| 222 | if err != nil { |
| 223 | return err |
| 224 | } |
| 225 | file.Content = raw |
| 226 | return nil |
| 227 | } |
| 228 | |
| 229 | // lstatResult captures the subset of output-path information the command needs, |
| 230 | // determined without following a symlink at the path. |
no test coverage detected