Download mods/diff/hooks/git/probes/is-transient.ts from SaylorTwift/claude-code: direct link, hf CLI and curl.
- Browser
- Download file 761 Bytes
-
https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/git/probes/is-transient.ts
- Command line
-
hf download hf://SaylorTwift/claude-code/mods/diff/hooks/git/probes/is-transient.ts
-
curl -L -o is-transient.ts https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/git/probes/is-transient.ts
761 Bytes
| import type Types from '../types' | |
| import { TRANSIENT_STATE_FILES } from './transient-state-files' | |
| /** | |
| * Whether the repository is mid-merge, mid-rebase, mid-cherry-pick or | |
| * mid-revert, from one listing of the git directory. | |
| * | |
| * A state file counts only as a real file; a symbolic link by that name is | |
| * never touched. | |
| * | |
| * @param entryKindsOf the host's directory listing | |
| * @param gitDir the repository's own git directory, absolute | |
| * @returns whether any of TRANSIENT_STATE_FILES is present as a file | |
| */ | |
| export async function isTransient( | |
| entryKindsOf: Types.GitDeps['entryKindsOf'], | |
| gitDir: string, | |
| ): Promise<boolean> { | |
| const entries = await entryKindsOf(gitDir) | |
| return TRANSIENT_STATE_FILES.some(file => entries?.get(file) === 'file') | |
| } | |