Merge status codes from --name-status into GitFileInfo[] from --numstat
(files: GitFileInfo[], statuses: ChangedFileInfo[])
| 960 | |
| 961 | /** Merge status codes from --name-status into GitFileInfo[] from --numstat */ |
| 962 | function mergeFileStatuses(files: GitFileInfo[], statuses: ChangedFileInfo[]): void { |
| 963 | const statusMap = new Map(statuses.map((s) => [s.path, s.status])) |
| 964 | for (const file of files) { |
| 965 | file.status = statusMap.get(file.path) ?? "modified" |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | function parseNumstatStats(output: string): UncommittedChangesStats { |
| 970 | if (!output.trim()) { |
no test coverage detected