Skip to content

extractChangedPathsFromDiff

extractChangedPathsFromDiff(diff): string[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/review/src/utils/diffPaths.ts:158

Extract the repository-relative POSIX paths a unified diff touches, in the order the diff names them and with duplicates removed.

De-duplication matters because the overwhelmingly common header names the same path twice (a/x b/x), and a caller reporting how many files a review saw would otherwise double every count. A rename’s two distinct paths both survive it.

Content that is not a unified diff — a requirements document, --content-source text output — simply yields an empty list. There is no error here: deciding what an empty result means belongs to the caller, which is the only place that knows whether a diff was expected.

string

string[]