diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-31 12:00:40 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-31 12:00:40 +0100 |
commit | 387683bbcf40ed48e0f1ad0884970712f9682b9e (patch) | |
tree | c13eee66eb19b4126d69543312efa12c7a7d389f /options.go | |
parent | f7da595e8aef658cd3dfed897b84ada2b0eac921 (diff) | |
download | go-git-387683bbcf40ed48e0f1ad0884970712f9682b9e.tar.gz |
config: RefSpec.Validate returning errors and doc (Fixes #232)
Diffstat (limited to 'options.go')
-rw-r--r-- | options.go | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -15,8 +15,7 @@ const ( ) var ( - ErrMissingURL = errors.New("URL field is required") - ErrInvalidRefSpec = errors.New("invalid refspec") + ErrMissingURL = errors.New("URL field is required") ) // CloneOptions describes how a clone should be performed @@ -110,8 +109,8 @@ func (o *FetchOptions) Validate() error { } for _, r := range o.RefSpecs { - if !r.IsValid() { - return ErrInvalidRefSpec + if err := r.Validate(); err != nil { + return err } } @@ -142,8 +141,8 @@ func (o *PushOptions) Validate() error { } for _, r := range o.RefSpecs { - if !r.IsValid() { - return ErrInvalidRefSpec + if err := r.Validate(); err != nil { + return err } } |