MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / getGitSummary

Function getGitSummary

src/core/agent.ts:113–128  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

111}
112
113function getGitSummary(cwd: string): string {
114 try {
115 const branch = execSync("git rev-parse --abbrev-ref HEAD", { cwd, stdio: ["ignore", "pipe", "ignore"] })
116 .toString()
117 .trim()
118 const status = execSync("git status --short", { cwd, stdio: ["ignore", "pipe", "ignore"] })
119 .toString()
120 .trimEnd()
121 .split("\n")
122 .slice(0, 20)
123 .join("\n")
124 return `## Git Repository Information\n- Current Branch: ${branch}\n${status ? `\n### Working Tree Changes\n${status}` : "- Working tree clean"}`
125 } catch {
126 return ""
127 }
128}
129
130/**
131 * The user's message is wrapped in <user_query> tags internally so the TUI can

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected