aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-09-11 20:23:36 +0200
committerGitHub <noreply@github.com>2017-09-11 20:23:36 +0200
commit032ec287ec496117dc85cd0e9c9224b2b17f5398 (patch)
tree582a03b677b2a4c34c46c83f6511ad141c7b3ccb /remote.go
parentbb3217ce5d5ed682a5c830c40ea031d3c92a8a7e (diff)
parent52c1f982ea0004de419d1a7f69d7eaf8b8d6b659 (diff)
downloadgo-git-032ec287ec496117dc85cd0e9c9224b2b17f5398.tar.gz
Merge pull request #587 from keybase/strib/skip-compression-gh-master
config: support a configurable, and turn-off-able, pack.window
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/remote.go b/remote.go
index 34ea7f5..fca539d 100644
--- a/remote.go
+++ b/remote.go
@@ -797,17 +797,21 @@ func referencesToHashes(refs storer.ReferenceStorer) ([]plumbing.Hash, error) {
func pushHashes(
ctx context.Context,
sess transport.ReceivePackSession,
- sto storer.EncodedObjectStorer,
+ s storage.Storer,
req *packp.ReferenceUpdateRequest,
hs []plumbing.Hash,
) (*packp.ReportStatus, error) {
rd, wr := io.Pipe()
req.Packfile = rd
+ config, err := s.Config()
+ if err != nil {
+ return nil, err
+ }
done := make(chan error)
go func() {
- e := packfile.NewEncoder(wr, sto, false)
- if _, err := e.Encode(hs); err != nil {
+ e := packfile.NewEncoder(wr, s, false)
+ if _, err := e.Encode(hs, config.Pack.Window); err != nil {
done <- wr.CloseWithError(err)
return
}