Validate validates the fields and sets the default values.
()
| 224 | |
| 225 | // Validate validates the fields and sets the default values. |
| 226 | func (o *FetchOptions) Validate() error { |
| 227 | if o.RemoteName == "" { |
| 228 | o.RemoteName = DefaultRemoteName |
| 229 | } |
| 230 | |
| 231 | if o.Tags == InvalidTagMode { |
| 232 | o.Tags = TagFollowing |
| 233 | } |
| 234 | |
| 235 | for _, r := range o.RefSpecs { |
| 236 | if err := r.Validate(); err != nil { |
| 237 | return err |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | return nil |
| 242 | } |
| 243 | |
| 244 | // PushOptions describes how a push should be performed. |
| 245 | type PushOptions struct { |