MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / worktreeMismatchWarning

Function worktreeMismatchWarning

src/sync/worktree.ts:226–237  ·  view source on GitHub ↗
(
  m: WorktreeIndexMismatch,
  audience: 'user' | 'agent' = 'user',
)

Source from the content-addressed store, hash-verified

224 * prints it for the user, and `codegraph_status` shows the agent's wording.
225 */
226export function worktreeMismatchWarning(
227 m: WorktreeIndexMismatch,
228 audience: 'user' | 'agent' = 'user',
229): string {
230 return (
231 `This CodeGraph index belongs to a different git working tree.\n` +
232 ` Running in: ${m.worktreeRoot}\n` +
233 ` Index from: ${m.indexRoot}\n` +
234 `Results reflect that tree's code (often a different branch), not this worktree — ` +
235 `symbols changed only here are missing. ${worktreeIndexAdvice(audience)}`
236 );
237}
238
239/**
240 * Compact, single-line variant for prefixing a tool's result. Read tools

Callers 3

handleStatusMethod · 0.90
mainFunction · 0.90

Calls 1

worktreeIndexAdviceFunction · 0.85

Tested by

no test coverage detected