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

Function IsDotGitName

internal/pathutil/dotgit.go:15–21  ·  view source on GitHub ↗

IsDotGitName reports whether name is `.git` or its 8.3 NTFS short alias `git~1`, case-insensitively. Both are forbidden as path components (and as submodule names) because they refer to the repository's own metadata directory. File names that do not conform to the 8.3 format (up to eight characters

(name string)

Source from the content-addressed store, hash-verified

13// the `C:` drive by default — which means that `git~1/` is a valid
14// way to refer to `.git/`.
15func IsDotGitName(name string) bool {
16 switch strings.ToLower(name) {
17 case ".git", "git~1":
18 return true
19 }
20 return false
21}

Callers 4

isDotGitVariantFunction · 0.92
ValidTreePathFunction · 0.85
WindowsValidPathFunction · 0.85
TestIsDotGitNameFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsDotGitNameFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…