Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

protocol/packp: UploadPackResponse implementation #161

Merged
merged 8 commits into from
Dec 6, 2016
Merged

protocol/packp: UploadPackResponse implementation #161

merged 8 commits into from
Dec 6, 2016

Conversation

mcuadros
Copy link
Contributor

@mcuadros mcuadros commented Dec 5, 2016

This is the implementation of packp.UploadPackResponse basically handles all the responses after call FetchPack, the messages handled are shallow-update and server-response

The packp.UploadPackResponse implements io.ReadCloser allowing to read the packfile directly from it.

import (
"fmt"
"io"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space

import (
"bytes"

. "gopkg.in/check.v1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import group order

import (
"errors"
"io"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra spaces

import (
"bytes"

. "gopkg.in/check.v1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import group order

"gopkg.in/src-d/go-git.v4/plumbing"
)

type ServerResponseSuite struct{}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add at least 1 test for unexpected flush and 1 test for malformed input.

return r.r.Read(p)
}

// Close the underlying reading, if any
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reading -> reader

. "gopkg.in/check.v1"
)

type UploadPackResponseSuite struct{}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add a test for malformed input.

) {
res := packp.NewUploadPackResponse(req)
if err := res.Decode(r); err != nil {
return nil, fmt.Errorf("error decondig upload-pack response: %s", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deconding -> decoding

@@ -98,6 +98,32 @@ func (s *RemoteSuite) TestFetch(c *C) {
}
}

func (s *RemoteSuite) TestFetchDeept(c *C) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deept -> Depth or Deept -> Deep

"gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/fixtures"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/storage/memory"

"strings"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import group order

@codecov-io
Copy link

codecov-io commented Dec 6, 2016

Current coverage is 76.82% (diff: 88.34%)

Merging #161 into master will decrease coverage by 0.43%

@@             master       #161   diff @@
==========================================
  Files            83         86     +3   
  Lines          5326       5407    +81   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           4115       4154    +39   
- Misses          754        805    +51   
+ Partials        457        448     -9   

Powered by Codecov. Last update 2092a55...4d379c4

@smola smola changed the title protocol/pakp: UploadPackResponse implementation protocol/packp: UploadPackResponse implementation Dec 6, 2016
@mcuadros mcuadros merged commit 0bcd1fc into src-d:master Dec 6, 2016
@mcuadros mcuadros deleted the non-nak-response branch December 13, 2016 10:13
mcuadros added a commit that referenced this pull request Jan 31, 2017
* plumbing/protocol: paktp avoid duplication of haves, wants and shallow

* protocol/pakp: UploadPackResponse implementation

* changes

* changes

* changes

* debug

* changes
gsalingu-ovhus pushed a commit to gsalingu-ovhus/go-git that referenced this pull request Mar 28, 2019
Display Golang version on build info
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants