aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/capability/list.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-06-23 19:20:07 +0200
committerSantiago M. Mola <santi@mola.io>2017-06-23 19:20:07 +0200
commitcb55d396c8fdeae4975592e7bc973c354f73bd63 (patch)
tree6872ba552358bb1e316de5c6e28067d1e6f77746 /plumbing/protocol/packp/capability/list.go
parentad02bf020460c210660db4fffda7f926b6aae95a (diff)
downloadgo-git-cb55d396c8fdeae4975592e7bc973c354f73bd63.tar.gz
capability: accept unknown capabilities, fixes #450
GitHub has started using a non-standard capability "early-capabilities" with agent=git/github-g3daa19f21. This is breaking all go-git operations on GitHub. This commit removes validation for known capabilities, so that we can use non-standard capabilities safely.
Diffstat (limited to 'plumbing/protocol/packp/capability/list.go')
-rw-r--r--plumbing/protocol/packp/capability/list.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/plumbing/protocol/packp/capability/list.go b/plumbing/protocol/packp/capability/list.go
index 69fdb51..3904a4e 100644
--- a/plumbing/protocol/packp/capability/list.go
+++ b/plumbing/protocol/packp/capability/list.go
@@ -8,8 +8,6 @@ import (
)
var (
- // ErrUnknownCapability is returned if a unknown capability is given
- ErrUnknownCapability = errors.New("unknown capability")
// ErrArgumentsRequired is returned if no arguments are giving with a
// capability that requires arguments
ErrArgumentsRequired = errors.New("arguments required")
@@ -119,10 +117,6 @@ func (l *List) Add(c Capability, values ...string) error {
}
func (l *List) validate(c Capability, values []string) error {
- if _, ok := valid[c]; !ok {
- return ErrUnknownCapability
- }
-
if requiresArgument[c] && len(values) == 0 {
return ErrArgumentsRequired
}