MCPcopy Create free account
hub / github.com/github/gh-aw / getProtectedPathPrefixes

Function getProtectedPathPrefixes

pkg/workflow/runtime_definitions.go:256–264  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
256func 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 "/").

Calls 1

MergeUniqueFunction · 0.92

Tested by

no test coverage detected