API: error 500 when accessing branches of a newly created project
Created by: justahero
On a newly created project accessing the branches via API (GET /projects/:id/repository/branches
) results in a 500 error.
The method user_project.repo
returns nil. It calls Project.repository
and can not create a valid repository, because the call to Repositoy.new
throws an error.
I added a user via admin account and created a new project. Accessing the project via web client lists the necessary steps to push the first commit to the repository. When I use the API call GET /projects/:id/repository/branches
with curl it returns a 500 error. Unfortunately I could not reproduce this behaviour in a spec test, it returns 200 Ok
.