(entries: StatusEntry[])
| 150 | * so a v1 parser sees the shape it expects. |
| 151 | */ |
| 152 | export function formatPorcelainV1(entries: StatusEntry[]): string { |
| 153 | if (entries.length === 0) return ""; |
| 154 | const lines: string[] = []; |
| 155 | for (const e of entries) { |
| 156 | if (e.worktree === "?") { |
| 157 | lines.push(`?? ${e.path}`); |
| 158 | } else { |
| 159 | lines.push(`${e.index}${e.worktree} ${e.path}`); |
| 160 | } |
| 161 | } |
| 162 | return `${lines.join("\n")}\n`; |
| 163 | } |
| 164 | |
| 165 | /** Render `entries` as `--short` output. */ |
| 166 | export function formatShort(entries: StatusEntry[]): string { |
no test coverage detected