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

Function gitUserName

src/ui-server/api/trails.ts:467–482  ·  view source on GitHub ↗
(projectRoot: string)

Source from the content-addressed store, hash-verified

465}
466
467function gitUserName(projectRoot: string): string | null {
468 try {
469 const out = execFileSync('git', ['config', 'user.name'], {
470 cwd: projectRoot,
471 encoding: 'utf-8',
472 timeout: 2_000,
473 stdio: ['ignore', 'pipe', 'ignore'],
474 windowsHide: true,
475 });
476 const name = out.trim();
477 return name === '' ? null : name.slice(0, 120);
478 } catch {
479 // No git, no config, not a repository — all ordinary. Fall through.
480 return null;
481 }
482}
483
484function osUserName(): string | null {
485 try {

Callers 1

trailAuthorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected