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

transport/http: fix partial request with haves. Fix #216. #221

Merged
merged 2 commits into from
Jan 24, 2017
Merged

transport/http: fix partial request with haves. Fix #216. #221

merged 2 commits into from
Jan 24, 2017

Conversation

ajnavarro
Copy link
Contributor

@ajnavarro ajnavarro commented Jan 24, 2017

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.

@ajnavarro ajnavarro changed the title transport/http: fix partial request with haves. WIP: transport/http: fix partial request with haves. Jan 24, 2017
@ajnavarro ajnavarro changed the title WIP: transport/http: fix partial request with haves. transport/http: fix partial request with haves. Jan 24, 2017
@@ -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.
Copy link
Contributor Author

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.

@codecov-io
Copy link

codecov-io commented Jan 24, 2017

Current coverage is 76.25% (diff: 40.00%)

Merging #221 into master will decrease coverage by 0.66%

@@             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   

Powered by Codecov. Last update 85a1642...b6423ea

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.
@ajnavarro ajnavarro changed the title transport/http: fix partial request with haves. transport/http: fix partial request with haves. Fix #216. Jan 24, 2017
@@ -69,7 +69,7 @@ type UploadHaves struct {
}

// Encode encodes the UploadHaves into the Writer.
Copy link
Collaborator

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 {
Copy link
Collaborator

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.

@mcuadros mcuadros merged commit 892372b into src-d:master Jan 24, 2017
gsalingu-ovhus pushed a commit to gsalingu-ovhus/go-git that referenced this pull request Mar 28, 2019
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.

5 participants