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

Method matchGlob

config/refspec.go:100–114  ·  view source on GitHub ↗
(n plumbing.ReferenceName)

Source from the content-addressed store, hash-verified

98}
99
100func (s RefSpec) matchGlob(n plumbing.ReferenceName) bool {
101 src := s.Src()
102 name := n.String()
103 wildcard := strings.Index(src, refSpecWildcard)
104
105 var prefix, suffix string
106 prefix = src[0:wildcard]
107 if len(src) > wildcard+1 {
108 suffix = src[wildcard+1:]
109 }
110
111 return len(name) >= len(prefix)+len(suffix) &&
112 strings.HasPrefix(name, prefix) &&
113 strings.HasSuffix(name, suffix)
114}
115
116// Dst returns the destination for the given remote reference.
117func (s RefSpec) Dst(n plumbing.ReferenceName) plumbing.ReferenceName {

Callers 1

MatchMethod · 0.95

Calls 3

SrcMethod · 0.95
StringMethod · 0.65
IndexMethod · 0.65

Tested by

no test coverage detected