aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-22 23:41:48 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-22 23:41:48 +0200
commit5913aee5004ff5b32c7926dda3af1f946d203f33 (patch)
treec9b3ce9e4439faf0313749690a3a0e496e32447d /remote.go
parent001bb130fe6186421f3ddcc556854410edd8d95e (diff)
downloadgo-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.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/remote.go b/remote.go
index 3e341fa..a2fa80e 100644
--- a/remote.go
+++ b/remote.go
@@ -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