Handle case when a fetchin commits from a GitHub repo that has no commits

This commit is contained in:
Alex Cabal 2025-02-24 11:56:36 -06:00
parent a0ea3949ac
commit 3ff13397f0

View file

@ -638,6 +638,11 @@ final class Project{
throw new Exceptions\AppException('Server did not respond with a string: ' . $response);
}
// GitHub API returns `HTTP 409 Conflict` if the repository is empty.
if($httpCode == Enums\HttpCode::Conflict->value){
return;
}
if($httpCode != Enums\HttpCode::Ok->value){
throw new Exception('Server responded with HTTP ' . $httpCode . '.');
}