MCPcopy Create free account
hub / github.com/go-git/go-git / Validate

Method Validate

config/modules.go:96–110  ·  view source on GitHub ↗

Validate validates the fields and sets the default values.

()

Source from the content-addressed store, hash-verified

94
95// Validate validates the fields and sets the default values.
96func (m *Submodule) Validate() error {
97 if m.Path == "" {
98 return ErrModuleEmptyPath
99 }
100
101 if m.URL == "" {
102 return ErrModuleEmptyURL
103 }
104
105 if dotdotPath.MatchString(m.Path) {
106 return ErrModuleBadPath
107 }
108
109 return nil
110}
111
112func (m *Submodule) unmarshal(s *format.Subsection) {
113 m.raw = s

Callers 4

TestValidateBadPathMethod · 0.95
unmarshalSubmodulesFunction · 0.95

Calls

no outgoing calls

Tested by 3

TestValidateBadPathMethod · 0.76