aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/capability/list.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/protocol/packp/capability/list.go')
-rw-r--r--plumbing/protocol/packp/capability/list.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plumbing/protocol/packp/capability/list.go b/plumbing/protocol/packp/capability/list.go
index 7197d36..2847580 100644
--- a/plumbing/protocol/packp/capability/list.go
+++ b/plumbing/protocol/packp/capability/list.go
@@ -48,6 +48,11 @@ func (l *List) IsEmpty() bool {
// Decode decodes list of capabilities from raw into the list
func (l *List) Decode(raw []byte) error {
+ // git 1.x receive pack used to send a leading space on its
+ // git-receive-pack capabilities announcement. We just trim space to be
+ // tolerant to space changes in different versions.
+ raw = bytes.TrimSpace(raw)
+
if len(raw) == 0 {
return nil
}