I'm using the GitLab API (http://doc.gitlab.com/ce/api/) to try to search for a specific file. I can successfully access a specific repository, but I was hoping to provide some text and retrieve any files that match the filename. If not that, then to at least get the full file structure of everything within the repository and do the search myself. Is this possible?
http://doc.gitlab.com/ce/api/repositories.html
I didnt skim through the full API docs, but a quick hack would be to list down the trees, you will get Gitlab ObjectifiedHash, run a loop and inside the loop put a condition saying if the type is a 'tree', then send its respective id again to fetch its tree and so on recursively and if its a blob, just save the name.
This way you get all the files/folder name. This is a bad way of doing it since you will do quite a few api calls. Read through the API docs fully.
I know this post is old, just answered anyway. Hope it helped
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With