aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/ulreq_decode.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-11-30 18:57:10 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-11-30 18:57:10 +0100
commit7de79aef5d4aa3100382d4df3e99525f9949e8d1 (patch)
tree2d218d1084d3badfd9acadfb41e61edff254428d /plumbing/protocol/packp/ulreq_decode.go
parentbd3dd4d421299699854bfe0353aae312bcf8c97c (diff)
downloadgo-git-7de79aef5d4aa3100382d4df3e99525f9949e8d1.tar.gz
capability: support empty input on Decode. (#153)
Calling capability.List's Decode with nil input will have no effect. This is useful in other decoders, where an empty capability list is received as an empty byte slice.
Diffstat (limited to 'plumbing/protocol/packp/ulreq_decode.go')
-rw-r--r--plumbing/protocol/packp/ulreq_decode.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/plumbing/protocol/packp/ulreq_decode.go b/plumbing/protocol/packp/ulreq_decode.go
index 812af5b..541a077 100644
--- a/plumbing/protocol/packp/ulreq_decode.go
+++ b/plumbing/protocol/packp/ulreq_decode.go
@@ -110,10 +110,6 @@ func (d *ulReqDecoder) readHash() (plumbing.Hash, bool) {
// Expected format: sp cap1 sp cap2 sp cap3...
func (d *ulReqDecoder) decodeCaps() stateFn {
- if len(d.line) == 0 {
- return d.decodeOtherWants
- }
-
d.line = bytes.TrimPrefix(d.line, sp)
if err := d.data.Capabilities.Decode(d.line); err != nil {
d.error("invalid capabilities: %s", err)