spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / hooks / git / parse / is-whole-answer / is-whole-answer.ts
12 lines · 408 BRaw
1import type Types from '../../types'
2import { isWholeListing } from '../is-whole-listing'
3
4/**
5 * Whether a `-z` git child both succeeded and answered a whole listing,
6 * so its stdout may be parsed (isWholeListing).
7 *
8 * @param result what the child left
9 * @returns whether to parse it
10 */
11export const isWholeAnswer = (result: Types.RunResult) =>
12 result.exitCode === 0 && isWholeListing(result.stdout)