deduplicateFiles removes duplicate paths, keeping the first occurrence.
(files []FileEntry)
| 140 | |
| 141 | // deduplicateFiles removes duplicate paths, keeping the first occurrence. |
| 142 | func deduplicateFiles(files []FileEntry) []FileEntry { |
| 143 | seen := make(map[string]bool, len(files)) |
| 144 | var result []FileEntry |
| 145 | for _, f := range files { |
| 146 | if seen[f.Path] { |
| 147 | continue |
| 148 | } |
| 149 | seen[f.Path] = true |
| 150 | result = append(result, f) |
| 151 | } |
| 152 | return result |
| 153 | } |
| 154 | |
| 155 | // checkExistence stats each file path relative to projectRoot and sets Exists and IsDir. |
| 156 | func checkExistence(files []FileEntry, projectRoot string) { |