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 / argv / pinned-lead-of / pinned-lead-of.ts
18 lines · 586 BRaw
1import type Types from '../../types'
2
3/**
4 * The argv that leads every git child once the repository is pinned: its
5 * git directory and working tree named, as the built-in panel pins them.
6 *
7 * With `--git-dir` given git discovers nothing from its cwd, so a nested
8 * repository the shell later moves into is never the one read.
9 *
10 * @param repository the session's pinned repository
11 * @returns the leading argv
12 */
13export const pinnedLeadOf = (
14 repository: Types.Repository,
15): readonly string[] => [
16 `--git-dir=${repository.gitDir}`,
17 `--work-tree=${repository.toplevel}`,
18]