-
Notifications
You must be signed in to change notification settings - Fork 534
transport/http: fix partial request with haves. Fix #216. #221
transport/http: fix partial request with haves. Fix #216. #221
Conversation
@@ -38,3 +38,8 @@ func (s *UploadPackSuite) TestAdvertisedReferencesNotExists(c *C) { | |||
c.Assert(err, Equals, transport.ErrRepositoryNotFound) | |||
c.Assert(r, IsNil) | |||
} | |||
|
|||
// TODO revList implementation is returning more objects than expected. |
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.
I opened an issue (#222) to fix this problem.
Current coverage is 76.25% (diff: 40.00%)@@ master #221 diff @@
==========================================
Files 96 96
Lines 6299 6300 +1
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 4845 4804 -41
- Misses 922 972 +50
+ Partials 532 524 -8
|
Fix #216 Using the http transport, now if we request a partial packfile, (using haves that aren't head ones) the response is not an empty packfile. Skip this test in server implementation. Revlist implementation is returning more objects than expected.
@@ -69,7 +69,7 @@ type UploadHaves struct { | |||
} | |||
|
|||
// Encode encodes the UploadHaves into the Writer. |
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.
Add documentation about what does the flush parameter and why.
@@ -171,10 +171,13 @@ func uploadPackRequestToReader(req *packp.UploadPackRequest) (*bytes.Buffer, err | |||
return nil, fmt.Errorf("sending upload-req message: %s", err) | |||
} | |||
|
|||
if err := req.UploadHaves.Encode(buf); err != nil { | |||
if err := req.UploadHaves.Encode(buf, false); err != nil { |
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.
Here UploadRequest is adding a flush, but UploadHaves is not? This seems a partial fix, since it's still against the HTTP protocol as specified here: https://github.com/git/git/blob/4e59582ff70d299f5a88449891e78d15b4b3fabe/Documentation/technical/http-protocol.txt#L302
Let's be triple check this.
Using the http transport, now if we request a partial packfile, (using haves that aren't head ones) the response is not an empty packfile.
Skip this test in server implementation. Revlist is returning more objects than expected.