From 3ff13397f04c2382cd80a997414711a4596bab3c Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Mon, 24 Feb 2025 11:56:36 -0600 Subject: [PATCH] Handle case when a fetchin commits from a GitHub repo that has no commits --- lib/Project.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Project.php b/lib/Project.php index 87817765..5270b327 100644 --- a/lib/Project.php +++ b/lib/Project.php @@ -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 . '.'); }