Validate validates the fields and sets the default values.
()
| 110 | |
| 111 | // Validate validates the fields and sets the default values. |
| 112 | func (o *CloneOptions) Validate() error { |
| 113 | if o.URL == "" { |
| 114 | return ErrMissingURL |
| 115 | } |
| 116 | |
| 117 | if o.RemoteName == "" { |
| 118 | o.RemoteName = DefaultRemoteName |
| 119 | } |
| 120 | |
| 121 | if o.ReferenceName == "" { |
| 122 | o.ReferenceName = plumbing.HEAD |
| 123 | } |
| 124 | |
| 125 | if o.Tags == InvalidTagMode { |
| 126 | o.Tags = AllTags |
| 127 | } |
| 128 | |
| 129 | return nil |
| 130 | } |
| 131 | |
| 132 | // PullOptions describes how a pull should be performed. |
| 133 | type PullOptions struct { |
nothing calls this directly
no outgoing calls
no test coverage detected