(error: unknown)
| 40 | } |
| 41 | |
| 42 | export function formatGitCommandError(error: unknown) { |
| 43 | if (!(error instanceof Error)) { |
| 44 | return 'Git command failed.' |
| 45 | } |
| 46 | |
| 47 | const details = [ |
| 48 | 'stdout' in error && typeof error.stdout === 'string' ? error.stdout.trim() : '', |
| 49 | 'stderr' in error && typeof error.stderr === 'string' ? error.stderr.trim() : '', |
| 50 | error.message, |
| 51 | ] |
| 52 | .find((value) => value.length > 0) |
| 53 | ?.replace(/\s+/g, ' ') |
| 54 | .trim() |
| 55 | |
| 56 | return details && details.length > 0 ? details : 'Git command failed.' |
| 57 | } |
| 58 | |
| 59 | export async function hasHeadCommit(projectId: string) { |
| 60 | try { |
no outgoing calls
no test coverage detected