aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-31 12:00:40 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-31 12:00:40 +0100
commit387683bbcf40ed48e0f1ad0884970712f9682b9e (patch)
treec13eee66eb19b4126d69543312efa12c7a7d389f /options.go
parentf7da595e8aef658cd3dfed897b84ada2b0eac921 (diff)
downloadgo-git-387683bbcf40ed48e0f1ad0884970712f9682b9e.tar.gz
config: RefSpec.Validate returning errors and doc (Fixes #232)
Diffstat (limited to 'options.go')
-rw-r--r--options.go11
1 files changed, 5 insertions, 6 deletions
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
}
}