Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from fluxcd/reenable-multiack
Browse files Browse the repository at this point in the history
Enable `multi_ack` and `multi_ack_detailed` capability
  • Loading branch information
pjbgf authored Oct 19, 2022
2 parents 226eda6 + dcf3dce commit b33dae7
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 12 deletions.
5 changes: 0 additions & 5 deletions plumbing/protocol/packp/srvresp.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ type ServerResponse struct {
// Decode decodes the response into the struct, isMultiACK should be true, if
// the request was done with multi_ack or multi_ack_detailed capabilities.
func (r *ServerResponse) Decode(reader *bufio.Reader, isMultiACK bool) error {
// TODO: implement support for multi_ack or multi_ack_detailed responses
if isMultiACK {
return errors.New("multi_ack and multi_ack_detailed are not supported")
}

s := pktline.NewScanner(reader)

for s.Scan() {
Expand Down
2 changes: 1 addition & 1 deletion plumbing/protocol/packp/srvresp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ func (s *ServerResponseSuite) TestDecodeMalformed(c *C) {
func (s *ServerResponseSuite) TestDecodeMultiACK(c *C) {
sr := &ServerResponse{}
err := sr.Decode(bufio.NewReader(bytes.NewBuffer(nil)), true)
c.Assert(err, NotNil)
c.Assert(err, IsNil)
}
2 changes: 1 addition & 1 deletion plumbing/protocol/packp/uppackresp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (s *UploadPackResponseSuite) TestDecodeMultiACK(c *C) {
defer res.Close()

err := res.Decode(ioutil.NopCloser(bytes.NewBuffer(nil)))
c.Assert(err, NotNil)
c.Assert(err, IsNil)
}

func (s *UploadPackResponseSuite) TestReadNoDecode(c *C) {
Expand Down
2 changes: 0 additions & 2 deletions plumbing/transport/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ func parseFile(endpoint string) (*Endpoint, bool) {
// UnsupportedCapabilities are the capabilities not supported by any client
// implementation
var UnsupportedCapabilities = []capability.Capability{
capability.MultiACK,
capability.MultiACKDetailed,
capability.ThinPack,
}

Expand Down
2 changes: 1 addition & 1 deletion plumbing/transport/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,5 @@ func (s *SuiteCommon) TestFilterUnsupportedCapabilities(c *C) {
l.Set(capability.MultiACK)

FilterUnsupportedCapabilities(l)
c.Assert(l.Supports(capability.MultiACK), Equals, false)
c.Assert(l.Supports(capability.MultiACK), Equals, true)
}
3 changes: 1 addition & 2 deletions plumbing/transport/test/upload_pack.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Package test implements common test suite for different transport
// implementations.
//
package test

import (
Expand Down Expand Up @@ -88,7 +87,7 @@ func (s *UploadPackSuite) TestAdvertisedReferencesFilterUnsupported(c *C) {

info, err := r.AdvertisedReferences()
c.Assert(err, IsNil)
c.Assert(info.Capabilities.Supports(capability.MultiACK), Equals, false)
c.Assert(info.Capabilities.Supports(capability.MultiACK), Equals, true)
}

func (s *UploadPackSuite) TestCapabilities(c *C) {
Expand Down

0 comments on commit b33dae7

Please sign in to comment.