isDotGitVariant reports whether part is .git, git~1, or an HFS+ equivalent of .git (when protectHFS is true). NTFS variants of .git (e.g. ".git " with trailing space, ".git::$INDEX_ALLOCATION") are detected separately by pathutil.WindowsValidPath, which applies regardless of position in the path. Bo
(part string, protectHFS bool)
| 168 | // regardless of position in the path. Both validators reuse this |
| 169 | // helper. |
| 170 | func isDotGitVariant(part string, protectHFS bool) bool { |
| 171 | if pathutil.IsDotGitName(part) { |
| 172 | return true |
| 173 | } |
| 174 | if protectHFS && pathutil.IsHFSDotGit(part) { |
| 175 | return true |
| 176 | } |
| 177 | return false |
| 178 | } |
| 179 | |
| 180 | // validPath checks whether paths are valid for the worktree |
| 181 | // filesystem abstraction. It is intentionally tolerant of .git as |
no test coverage detected
searching dependent graphs…