aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/common.go
diff options
context:
space:
mode:
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)
+ }
+}