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 / tiers / diff-data-of / diff-data-of.ts
27 lines · 809 BRaw
1import type Types from '../../types'
2import type { DiffBasis } from './diff-basis'
3
4/**
5 * A settled fetch: the tier's merged rows and totals over the repository
6 * and mode of the fetch, with the tier's basis.
7 *
8 * @param context the fetch
9 * @param result the rows and totals, untracked files merged or withheld
10 * @param basis what they compare and read against
11 * @returns the data an outcome carries
12 */
13export const diffDataOf = (
14 context: Types.FetchContext,
15 result: Types.MergedResult,
16 basis: DiffBasis,
17): Types.DiffData => ({
18 repository: context.repository,
19 mode: context.mode,
20 stats: result.stats,
21 files: result.files,
22 source: basis.source,
23 baseRef: basis.baseRef,
24 isUnborn: basis.isUnborn,
25 stalePaths: basis.stalePaths,
26 isUntrackedWithheld: result.isUntrackedWithheld,
27})