aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/updreq_encode.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-09 14:44:03 +0100
committerGitHub <noreply@github.com>2016-12-09 14:44:03 +0100
commit0e1a52757a3938e97cf7d31e0dff3c9949001763 (patch)
tree8b998fdc3eaaf6b2d6c69a125759a778664207a5 /plumbing/protocol/packp/updreq_encode.go
parent4f16cc925238aae81586e917d26b8ff6b6a340bd (diff)
downloadgo-git-0e1a52757a3938e97cf7d31e0dff3c9949001763.tar.gz
transport: add git-send-pack support to local/ssh. (#163)
* protocol/packp: add Packfile field to ReferenceUpdateRequest. * protocol/packp: add NewReferenceUpdateRequestFromCapabilities. * NewReferenceUpdateRequestFromCapabilities can be used to create a ReferenceUpdateRequest with initial capabilities compatible with the server. * protocol/packp: fix new line handling on report status. * transport/file: test error on unexisting command.
Diffstat (limited to 'plumbing/protocol/packp/updreq_encode.go')
-rw-r--r--plumbing/protocol/packp/updreq_encode.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/plumbing/protocol/packp/updreq_encode.go b/plumbing/protocol/packp/updreq_encode.go
index b2b7944..44c0573 100644
--- a/plumbing/protocol/packp/updreq_encode.go
+++ b/plumbing/protocol/packp/updreq_encode.go
@@ -29,6 +29,14 @@ func (r *ReferenceUpdateRequest) Encode(w io.Writer) error {
return err
}
+ if r.Packfile != nil {
+ if _, err := io.Copy(w, r.Packfile); err != nil {
+ return err
+ }
+
+ return r.Packfile.Close()
+ }
+
return nil
}