I would like to get a list of the entries in a git repository.
Say there is this repository https://github.com/owner/project with the structure:
- src
- lib.rs
- a.rs
- Cargo.toml
- README.md
How would I get an iterator over src, that will return [lib.rs, a.rs] (assuming I also know which branch I want to be on) ? Do I need to clone the whole repository, or is there a better way ?
Check out the Github GraphQL API. What you're looking for is almost certainly possible with that.
Edit from the Future: Note that Github also has something they call the "V3 API", which may be what turns up first when looking up "Github API" on search services. This is the old API and is much less expressive/powerful/efficient than the GraphQL API.
From what I'm seeing of the documentation, it seems you have to clone the whole repository somewhere though, no ? There may be another option but I am not at all familiar with git2 ...