MCPcopy
hub / github.com/go-git/go-git / isDotGitVariant

Function isDotGitVariant

worktree_fs.go:170–178  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

168// regardless of position in the path. Both validators reuse this
169// helper.
170func 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

Callers 1

validPathMethod · 0.85

Calls 2

IsDotGitNameFunction · 0.92
IsHFSDotGitFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…