aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 14:42:19 +0100
committerGitHub <noreply@github.com>2017-01-30 14:42:19 +0100
commita48bc6e17ef6298f93ec21cdf1a5e387640673b6 (patch)
treed2fa569b6c2c7699fa6f7c2a60b9bce90f1e55f8 /plumbing/protocol
parent77b6391a050743f3f0aa46018db65853c7167df5 (diff)
downloadgo-git-a48bc6e17ef6298f93ec21cdf1a5e387640673b6.tar.gz
Repository.Progress moved as a field in *Options (#237)
Diffstat (limited to 'plumbing/protocol')
-rw-r--r--plumbing/protocol/packp/sideband/demux.go3
-rw-r--r--plumbing/protocol/packp/sideband/demux_test.go11
2 files changed, 7 insertions, 7 deletions
diff --git a/plumbing/protocol/packp/sideband/demux.go b/plumbing/protocol/packp/sideband/demux.go
index 6470380..e16c497 100644
--- a/plumbing/protocol/packp/sideband/demux.go
+++ b/plumbing/protocol/packp/sideband/demux.go
@@ -11,9 +11,8 @@ import (
// ErrMaxPackedExceeded returned by Read, if the maximum packed size is exceeded
var ErrMaxPackedExceeded = errors.New("max. packed size exceeded")
-// Progress allows to read the progress information
+// Progress where the progress information is stored
type Progress interface {
- io.Reader
io.Writer
}
diff --git a/plumbing/protocol/packp/sideband/demux_test.go b/plumbing/protocol/packp/sideband/demux_test.go
index ee5f19a..3d2d6ed 100644
--- a/plumbing/protocol/packp/sideband/demux_test.go
+++ b/plumbing/protocol/packp/sideband/demux_test.go
@@ -84,23 +84,24 @@ func (s *SidebandSuite) TestDecodeFromFailingReader(c *C) {
func (s *SidebandSuite) TestDecodeWithProgress(c *C) {
expected := []byte("abcdefghijklmnopqrstuvwxyz")
- buf := bytes.NewBuffer(nil)
- e := pktline.NewEncoder(buf)
+ input := bytes.NewBuffer(nil)
+ e := pktline.NewEncoder(input)
e.Encode(PackData.WithPayload(expected[0:8]))
e.Encode(ProgressMessage.WithPayload([]byte{'F', 'O', 'O', '\n'}))
e.Encode(PackData.WithPayload(expected[8:16]))
e.Encode(PackData.WithPayload(expected[16:26]))
+ output := bytes.NewBuffer(nil)
content := make([]byte, 26)
- d := NewDemuxer(Sideband64k, buf)
- d.Progress = bytes.NewBuffer(nil)
+ d := NewDemuxer(Sideband64k, input)
+ d.Progress = output
n, err := io.ReadFull(d, content)
c.Assert(err, IsNil)
c.Assert(n, Equals, 26)
c.Assert(content, DeepEquals, expected)
- progress, err := ioutil.ReadAll(d.Progress)
+ progress, err := ioutil.ReadAll(output)
c.Assert(err, IsNil)
c.Assert(progress, DeepEquals, []byte{'F', 'O', 'O', '\n'})
}