MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / gitOrThrow

Function gitOrThrow

src/tools/git/git-runner.ts:100–107  ·  view source on GitHub ↗
(args: string[], opts: GitOptions)

Source from the content-addressed store, hash-verified

98 * For tools that want a clean exception flow rather than checking exitCode.
99 */
100export async function gitOrThrow(args: string[], opts: GitOptions): Promise<string> {
101 const r = await git(args, opts);
102 if (r.exitCode !== 0) {
103 const msg = (r.stderr || r.stdout || `git ${args.join(' ')} exited ${r.exitCode}`).trim();
104 throw new Error(msg);
105 }
106 return r.stdout;
107}
108
109/** Quick check: is this directory inside a git repo? */
110export async function isGitRepo(cwd: string, signal?: AbortSignal): Promise<boolean> {

Callers 1

executeMethod · 0.85

Calls 1

gitFunction · 0.70

Tested by

no test coverage detected