When using the API to create an app, if the GitHub repository is very new (eg. Created by the same process that calls the API) it seems there is a timing issue which causes the HEAD branch not to be found.
The creation fails with the API returning:
Response code 400
{
"message": "Could not clone git repository: Remote branch 'HEAD' not found in upstream origin",
"gitUrl": "(SSH URL of new repo)"
}
The failure would appear to occur in AppManager.java in the create(..) method at the point of the Git.cloneRepository()
It would be useful to have the option to wait/retry the clone.
Unfortunately it is unlikely a reliable test case could be created for recreation of the issue.
When using the API to create an app, if the GitHub repository is very new (eg. Created by the same process that calls the API) it seems there is a timing issue which causes the HEAD branch not to be found.
The creation fails with the API returning: Response code 400
The failure would appear to occur in AppManager.java in the create(..) method at the point of the Git.cloneRepository()
It would be useful to have the option to wait/retry the clone.
Unfortunately it is unlikely a reliable test case could be created for recreation of the issue.