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 / views / entries / body-entry-of / body-entry-of.ts
24 lines · 658 BRaw
1import Git from '../../../git'
2import type PaneState from '../../../pane-state'
3import type { BodyEntry } from '../body-entry'
4
5/**
6 * A fetched row as the pane draws it, its body looked up in what the pane
7 * has read.
8 *
9 * @param file the row
10 * @param model the pane's state, holding the bodies read so far
11 * @returns the entry
12 */
13export const bodyEntryOf = (
14 file: Git.FileStat,
15 model: Pick<PaneState.PaneModel, 'bodies'>,
16): BodyEntry => ({
17 path: file.path,
18 displayPath: Git.displayPathOf(file),
19 added: file.added,
20 removed: file.removed,
21 isUntracked: file.isUntracked,
22 isBinary: file.isBinary,
23 body: model.bodies.get(file.path),
24})