aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/common.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-12-01 09:59:19 +0100
committerGitHub <noreply@github.com>2016-12-01 09:59:19 +0100
commitc15bf1dff332873644290db0e186b8f5ad9b8fb2 (patch)
tree1dd79212333823b70f2792ad116864ea127e4a1c /plumbing/transport/common.go
parent7de79aef5d4aa3100382d4df3e99525f9949e8d1 (diff)
downloadgo-git-c15bf1dff332873644290db0e186b8f5ad9b8fb2.tar.gz
capabilities: full integration (#151)
* format/pktline: fix readPayloadLen err handling * protocol/pakp: UploadReq validation and creation of capabilities * protocol/pakp: AdvRef tests * protocol/pakp: capability.List.Delete * protocol: filter unsupported capabilities * remote capability negociation * transport: UploadRequest validation * requested changes
Diffstat (limited to 'plumbing/transport/common.go')
-rw-r--r--plumbing/transport/common.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/plumbing/transport/common.go b/plumbing/transport/common.go
index 9715a39..bfc999f 100644
--- a/plumbing/transport/common.go
+++ b/plumbing/transport/common.go
@@ -21,6 +21,7 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp"
+ "gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/capability"
)
var (
@@ -124,3 +125,22 @@ func transformSCPLikeIfNeeded(endpoint string) string {
return endpoint
}
+
+// UnsupportedCapabilities are the capabilities not supported by any client
+// implementation
+var UnsupportedCapabilities = []capability.Capability{
+ capability.MultiACK,
+ capability.MultiACKDetailed,
+ capability.Sideband,
+ capability.Sideband64k,
+ capability.ThinPack,
+}
+
+// FilterUnsupportedCapabilities it filter out all the UnsupportedCapabilities
+// from a capability.List, the intended usage is on the client implementation
+// to filter the capabilities from an AdvRefs message.
+func FilterUnsupportedCapabilities(list *capability.List) {
+ for _, c := range UnsupportedCapabilities {
+ list.Delete(c)
+ }
+}