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