Validate validates the fields and sets the default values.
()
| 302 | |
| 303 | // Validate validates the fields and sets the default values. |
| 304 | func (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. |
| 325 | type SubmoduleUpdateOptions struct { |