mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 22:30:30 -04:00
Handle case when a fetchin commits from a GitHub repo that has no commits
This commit is contained in:
parent
a0ea3949ac
commit
3ff13397f0
1 changed files with 5 additions and 0 deletions
|
@ -638,6 +638,11 @@ final class Project{
|
||||||
throw new Exceptions\AppException('Server did not respond with a string: ' . $response);
|
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){
|
if($httpCode != Enums\HttpCode::Ok->value){
|
||||||
throw new Exception('Server responded with HTTP ' . $httpCode . '.');
|
throw new Exception('Server responded with HTTP ' . $httpCode . '.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue