Needs a lot of work based on the comments:
# TODO(caleb/dmac): API authentication before filter. Need to assign users an API key and sign requests.
# NOTE(dmac): This can tie up the server if the checked out repo
# is very large. The task could be backgrounded, but the server's instance
# of MetaRepo will need to be reloaded after the background job finishes.
post "/api/add_repo" do
The cloning of the repo should be in a background job. We'll need to figure out how to make MetaRepo adapt to changing circumstances, or have the background job ping a "refresh" url which tells the metarepo to refresh itself.
This will be needed in preparation for adding a UI on top of it.
In b07ed72 and following, I've made this into a background job and made the rest of the app scan for new repos where needed. Please review those commits.