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 / fetch-context-of / fetch-context-of.ts
26 lines · 639 BRaw
1import Limits from '../../../limits'
2import Probes from '../../probes'
3import type Types from '../../types'
4
5/**
6 * The context every tier of a fetch shares: the host's pinned git, the
7 * repository, the mode, and one stamp probe over the working tree's top.
8 *
9 * @param deps the host
10 * @param mode the comparison asked for
11 * @returns the context
12 */
13export const fetchContextOf = (
14 deps: Types.GitDeps,
15 mode: Types.BaseMode,
16): Types.FetchContext => ({
17 deps,
18 run: deps.run,
19 repository: deps.repository,
20 mode,
21 stamps: Probes.stampProbeOf(
22 deps,
23 deps.repository.toplevel,
24 Limits.MAX_LISTED_DIRECTORIES,
25 ),
26})