File tree Expand file tree Collapse file tree
services/apps/git_integration/src/crowdgit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class ErrorCode(str, Enum):
2626 RATE_LIMITED = "rate-limited"
2727 ACCESS_FORBIDDEN = "access-forbidden"
2828 SERVER_ERROR = "server-error-remote"
29+ EMPTY_REPO = "empty-repo"
2930
3031
3132class RepositoryState (str , Enum ):
Original file line number Diff line number Diff line change @@ -144,3 +144,9 @@ class ForbiddenError(CrowdGitError):
144144class RemoteServerError (CrowdGitError ):
145145 error_message : str = "Remote server returned an internal error"
146146 error_code : ErrorCode = ErrorCode .SERVER_ERROR
147+
148+
149+ @dataclass
150+ class EmptyRepoError (CrowdGitError ):
151+ error_message : str = "Repository is empty (no branches or commits)"
152+ error_code : ErrorCode = ErrorCode .EMPTY_REPO
Original file line number Diff line number Diff line change 66 CommandExecutionError ,
77 CommandTimeoutError ,
88 DiskSpaceError ,
9+ EmptyRepoError ,
910 ForbiddenError ,
1011 NetworkError ,
1112 PermissionError ,
@@ -183,6 +184,10 @@ async def get_default_branch(repo_path: str) -> str:
183184 },
184185 RepoAuthRequiredError ,
185186 ),
187+ (
188+ {"ambiguous argument 'HEAD': unknown revision or path not in the working tree" },
189+ EmptyRepoError ,
190+ ),
186191]
187192
188193
You can’t perform that action at this time.
0 commit comments