-
Notifications
You must be signed in to change notification settings - Fork 534
protocol/packp: UploadPackResponse implementation #161
Conversation
import ( | ||
"fmt" | ||
"io" | ||
|
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" | ||
|
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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{} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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{} |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import group order
Current coverage is 76.82% (diff: 88.34%)@@ 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
|
* plumbing/protocol: paktp avoid duplication of haves, wants and shallow * protocol/pakp: UploadPackResponse implementation * changes * changes * changes * debug * changes
Display Golang version on build info
This is the implementation of
packp.UploadPackResponse
basically handles all the responses after call FetchPack, the messages handled areshallow-update
andserver-response
The
packp.UploadPackResponse
implementsio.ReadCloser
allowing to read the packfile directly from it.