Download mods/diff/hooks/git/fetch-diff/fetch-diff.ts from SaylorTwift/claude-code: direct link, hf CLI and curl.
- Browser
- Download file 955 Bytes
-
https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/git/fetch-diff/fetch-diff.ts
- Command line
-
hf download hf://SaylorTwift/claude-code/mods/diff/hooks/git/fetch-diff/fetch-diff.ts
-
curl -L -o fetch-diff.ts https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/git/fetch-diff/fetch-diff.ts
955 Bytes
| import Probes from '../probes' | |
| import Tiers from '../tiers' | |
| import type Types from '../types' | |
| /** | |
| * One fetch of the session's pinned repository, as the built-in panel | |
| * fetches; every git child names it so paths stay root-relative. | |
| * | |
| * Mid-merge, mid-rebase, mid-cherry-pick or mid-revert, or when git cannot | |
| * answer, it is unavailable and the caller keeps what it had. | |
| * | |
| * @param deps the host: pinned git, the repository, the file probes | |
| * @param mode what to compare against | |
| * @returns the outcome | |
| */ | |
| export async function fetchDiff( | |
| deps: Types.GitDeps, | |
| mode: Types.BaseMode, | |
| ): Promise<Types.FetchOutcome> { | |
| const isBusy = await Probes.isTransient( | |
| deps.entryKindsOf, | |
| deps.repository.gitDir, | |
| ) | |
| if (isBusy) { | |
| return { kind: 'unavailable' } | |
| } | |
| const context = Tiers.fetchContextOf(deps, mode) | |
| const isBranch = mode === 'branch' | |
| return isBranch ? Tiers.branchTier(context) : Tiers.workingTreeTier(context) | |
| } | |