aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
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