diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-22 23:41:48 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-22 23:41:48 +0200 |
commit | 5913aee5004ff5b32c7926dda3af1f946d203f33 (patch) | |
tree | c9b3ce9e4439faf0313749690a3a0e496e32447d /remote.go | |
parent | 001bb130fe6186421f3ddcc556854410edd8d95e (diff) | |
download | go-git-5913aee5004ff5b32c7926dda3af1f946d203f33.tar.gz |
test coverage improved, Remote.Refs and Repository.Refs returns error, TreeWalker -> TreeIter
Diffstat (limited to 'remote.go')
-rw-r--r-- | remote.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -114,7 +114,12 @@ func (r *Remote) Fetch(o *FetchOptions) (err error) { func (r *Remote) getWantedReferences(spec []config.RefSpec) ([]*core.Reference, error) { var refs []*core.Reference - return refs, r.Refs().ForEach(func(ref *core.Reference) error { + iter, err := r.Refs() + if err != nil { + return refs, err + } + + return refs, iter.ForEach(func(ref *core.Reference) error { if ref.Type() != core.HashReference { return nil } @@ -220,9 +225,8 @@ func (r *Remote) Ref(name core.ReferenceName, resolved bool) (*core.Reference, e } // Refs returns a map with all the References -func (r *Remote) Refs() core.ReferenceIter { - i, _ := r.upInfo.Refs.Iter() - return i +func (r *Remote) Refs() (core.ReferenceIter, error) { + return r.upInfo.Refs.Iter() } // Disconnect from the remote and save the config |