From 387683bbcf40ed48e0f1ad0884970712f9682b9e Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Tue, 31 Jan 2017 12:00:40 +0100 Subject: config: RefSpec.Validate returning errors and doc (Fixes #232) --- options.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'options.go') diff --git a/options.go b/options.go index 45d8463..120c472 100644 --- a/options.go +++ b/options.go @@ -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 } } -- cgit