(id: string, limit = 30)
| 460 | } |
| 461 | |
| 462 | export async function getGitLog(id: string, limit = 30): Promise<GitLogEntry[]> { |
| 463 | const res = await fetch( |
| 464 | `/api/workspaces/${encodeURIComponent(id)}/git/log?limit=${limit}`, |
| 465 | ); |
| 466 | if (!res.ok) throw new Error(`git log failed: ${res.status}`); |
| 467 | const body = (await res.json()) as { entries: GitLogEntry[] }; |
| 468 | return body.entries; |
| 469 | } |
| 470 | |
| 471 | export async function getGitStatus(id: string): Promise<GitStatus> { |
| 472 | const res = await fetch(`/api/workspaces/${encodeURIComponent(id)}/git/status`); |
no test coverage detected