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.
TypeScript
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)
}