aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-11-28 09:57:38 +0100
committerGitHub <noreply@github.com>2016-11-28 09:57:38 +0100
commit68893edf9ddc3de181431f1552e3b773cb66f080 (patch)
treef45e5fa18e10168a278b7d0ed7dea984ff9969f7 /repository.go
parentf9adb3565b36ba1573102f954d0ee916009efac2 (diff)
downloadgo-git-68893edf9ddc3de181431f1552e3b773cb66f080.tar.gz
remove old types from transport and use packp (#142)
* protocol: move UploadPackRequest to protocol. * UploadPackRequest is now defined as an embedding of UploadRequest and UploadHaves. * Move http encoding specific code from UploadPackRequest to transport/http. * rename UlReq to UploadRequest * packp: move AdvRefs Encoder/Decoder to Encode/Decode methods. * packp: move UploadRequest Encoder/Decoder to Encode/Decode methods. * packp: Remove transport.UploadPackInfo in favor of packp. AdvRefs.
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/repository.go b/repository.go
index ec3a1f9..a1a5cae 100644
--- a/repository.go
+++ b/repository.go
@@ -160,7 +160,7 @@ func (r *Repository) Clone(o *CloneOptions) error {
return err
}
- head, err := remote.Ref(o.ReferenceName, true)
+ head, err := remote.Reference(o.ReferenceName, true)
if err != nil {
return err
}
@@ -177,7 +177,12 @@ func (r *Repository) updateRemoteConfig(
return nil
}
- head, err := storer.ResolveReference(remote.Info().Refs, o.ReferenceName)
+ refs, err := remote.AdvertisedReferences().AllReferences()
+ if err != nil {
+ return err
+ }
+
+ head, err := storer.ResolveReference(refs, o.ReferenceName)
if err != nil {
return err
}
@@ -242,7 +247,7 @@ func (r *Repository) Pull(o *PullOptions) error {
defer remote.Disconnect()
- head, err := remote.Ref(o.ReferenceName, true)
+ head, err := remote.Reference(o.ReferenceName, true)
if err != nil {
return err
}