aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/fetch_pack.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-11-25 15:48:20 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-11-25 15:48:20 +0100
commitf9adb3565b36ba1573102f954d0ee916009efac2 (patch)
treeabc5b98e61b5851a985a215f7265ce2e9eb131f7 /plumbing/transport/fetch_pack.go
parentc1e0932c6cbcc55a78f338d437b9f13d89f33552 (diff)
downloadgo-git-f9adb3565b36ba1573102f954d0ee916009efac2.tar.gz
move: format/packp -> protocol/packp (#141)
* move: format/packp -> protocol/packp * format/packp -> protocol/packp * format/packp/pktline -> format/pktline. * move: protocol/packp/ulreq/* -> protocol/packp/* * protocol/packp: rename UlReq types to make them unique. * * protocol/packp: namespace UlReq encoder. * protocol/packp: namespace UlReq decoder. * protocol/packp: fix example names * move: protocol/packp/advrefs/* -> protocol/packp/* * further ulreq namespacing * protocol/packp: namespace AdvRefs types.
Diffstat (limited to 'plumbing/transport/fetch_pack.go')
-rw-r--r--plumbing/transport/fetch_pack.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/plumbing/transport/fetch_pack.go b/plumbing/transport/fetch_pack.go
index 5346e9d..14d3e19 100644
--- a/plumbing/transport/fetch_pack.go
+++ b/plumbing/transport/fetch_pack.go
@@ -8,14 +8,13 @@ import (
"strings"
"gopkg.in/src-d/go-git.v4/plumbing"
- "gopkg.in/src-d/go-git.v4/plumbing/format/packp"
- "gopkg.in/src-d/go-git.v4/plumbing/format/packp/advrefs"
- "gopkg.in/src-d/go-git.v4/plumbing/format/packp/pktline"
+ "gopkg.in/src-d/go-git.v4/plumbing/format/pktline"
+ "gopkg.in/src-d/go-git.v4/plumbing/protocol/packp"
"gopkg.in/src-d/go-git.v4/plumbing/storer"
"gopkg.in/src-d/go-git.v4/storage/memory"
)
-//TODO: Replace this by advrefs.AdvRefs.
+//TODO: Replace this by packpAdvRefs.
type UploadPackInfo struct {
Capabilities *packp.Capabilities
Refs memory.ReferenceStorage
@@ -29,10 +28,10 @@ func NewUploadPackInfo() *UploadPackInfo {
}
func (i *UploadPackInfo) Decode(r io.Reader) error {
- d := advrefs.NewDecoder(r)
- ar := advrefs.New()
+ d := packp.NewAdvRefsDecoder(r)
+ ar := packp.NewAdvRefs()
if err := d.Decode(ar); err != nil {
- if err == advrefs.ErrEmpty {
+ if err == packp.ErrEmpty {
return err
}
return plumbing.NewUnexpectedError(err)
@@ -47,7 +46,7 @@ func (i *UploadPackInfo) Decode(r io.Reader) error {
return nil
}
-func (i *UploadPackInfo) addRefs(ar *advrefs.AdvRefs) error {
+func (i *UploadPackInfo) addRefs(ar *packp.AdvRefs) error {
for name, hash := range ar.References {
ref := plumbing.NewReferenceFromStrings(name, hash.String())
i.Refs.SetReference(ref)
@@ -56,7 +55,7 @@ func (i *UploadPackInfo) addRefs(ar *advrefs.AdvRefs) error {
return i.addSymbolicRefs(ar)
}
-func (i *UploadPackInfo) addSymbolicRefs(ar *advrefs.AdvRefs) error {
+func (i *UploadPackInfo) addSymbolicRefs(ar *packp.AdvRefs) error {
if !hasSymrefs(ar) {
return nil
}
@@ -76,7 +75,7 @@ func (i *UploadPackInfo) addSymbolicRefs(ar *advrefs.AdvRefs) error {
return nil
}
-func hasSymrefs(ar *advrefs.AdvRefs) bool {
+func hasSymrefs(ar *packp.AdvRefs) bool {
return ar.Capabilities.Supports("symref")
}