getProtectedPathPrefixes returns non-dot path prefixes (relative to repo root) whose contents are always protected regardless of file basename. Dot-folder prefixes (e.g. ".github/", ".agents/", ".githooks/", ".husky/") are NOT included here because they are already covered by the general top-level
(extra ...string)
| 254 | // Only non-dot path prefixes need to be listed explicitly. |
| 255 | // Any dot-prefix entries in `extra` are also dropped for the same reason. |
| 256 | func getProtectedPathPrefixes(extra ...string) []string { |
| 257 | var nonDot []string |
| 258 | for _, p := range extra { |
| 259 | if len(p) < 2 || p[0] != '.' { |
| 260 | nonDot = append(nonDot, p) |
| 261 | } |
| 262 | } |
| 263 | return sliceutil.MergeUnique([]string(nil), nonDot...) |
| 264 | } |
| 265 | |
| 266 | // getDotFolderExcludes returns the subset of excludeFiles that are top-level |
| 267 | // dot-folder path prefixes (i.e. start with "." and end with "/"). |
no test coverage detected