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

Method Validate

options.go:304–322  ·  view source on GitHub ↗

Validate validates the fields and sets the default values.

()

Source from the content-addressed store, hash-verified

302
303// Validate validates the fields and sets the default values.
304func (o *PushOptions) Validate() error {
305 if o.RemoteName == "" {
306 o.RemoteName = DefaultRemoteName
307 }
308
309 if len(o.RefSpecs) == 0 {
310 o.RefSpecs = []config.RefSpec{
311 config.RefSpec(config.DefaultPushRefSpec),
312 }
313 }
314
315 for _, r := range o.RefSpecs {
316 if err := r.Validate(); err != nil {
317 return err
318 }
319 }
320
321 return nil
322}
323
324// SubmoduleUpdateOptions describes how a submodule update should be performed.
325type SubmoduleUpdateOptions struct {

Callers

nothing calls this directly

Calls 1

ValidateMethod · 0.45

Tested by

no test coverage detected