MCPcopy Create free account
hub / github.com/cloudflare/computer / formatPorcelainV1

Function formatPorcelainV1

packages/computer/src/git/status.ts:152–163  ·  view source on GitHub ↗
(entries: StatusEntry[])

Source from the content-addressed store, hash-verified

150 * so a v1 parser sees the shape it expects.
151 */
152export 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. */
166export function formatShort(entries: StatusEntry[]): string {

Callers 2

status.test.tsFile · 0.85
runStatusFunction · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected