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

Function TestIsDotGitName

internal/pathutil/dotgit_test.go:9–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestIsDotGitName(t *testing.T) {
10 t.Parallel()
11
12 tests := []struct {
13 name string
14 want bool
15 }{
16 {".git", true},
17 {".GIT", true},
18 {".Git", true},
19 {".gIt", true},
20 {"git~1", true},
21 {"GIT~1", true},
22 {"Git~1", true},
23
24 {"git", false},
25 {"GIT", false},
26 {".gitmodules", false},
27 {".gitignore", false},
28 {"git~", false},
29 {"git~10", false},
30 {"git~2", false}, // canonical short name is git~1; others are not denied
31 {"", false},
32 }
33
34 for _, tc := range tests {
35 t.Run(tc.name, func(t *testing.T) {
36 t.Parallel()
37 assert.Equal(t, tc.want, IsDotGitName(tc.name))
38 })
39 }
40}

Callers

nothing calls this directly

Calls 1

IsDotGitNameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…