Download mods/diff/hooks/git/display-path-of/display-path-of.ts from SaylorTwift/claude-code: direct link, hf CLI and curl.
- Browser
- Download file 514 Bytes
-
https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/git/display-path-of/display-path-of.ts
- Command line
-
hf download hf://SaylorTwift/claude-code/mods/diff/hooks/git/display-path-of/display-path-of.ts
-
curl -L -o display-path-of.ts https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/git/display-path-of/display-path-of.ts
514 Bytes
| import { renameDisplayOf } from '../rename-display-of' | |
| import type Types from '../types' | |
| /** | |
| * A row's name as the built-in lists it: the path, or for a rename the one | |
| * line `git diff --stat` prints for it (renameDisplayOf). | |
| * | |
| * @param file the row | |
| * @returns the name to draw and to sort by | |
| */ | |
| export function displayPathOf( | |
| file: Pick<Types.FileStat, 'path' | 'renamedFrom'>, | |
| ): string { | |
| const { renamedFrom, path } = file | |
| return renamedFrom === null ? path : renameDisplayOf(renamedFrom, path) | |
| } | |