diff options
author | Oleg Kovalov <iamolegkovalov@gmail.com> | 2020-07-06 16:50:56 +0200 |
---|---|---|
committer | Oleg Kovalov <iamolegkovalov@gmail.com> | 2020-07-06 16:50:56 +0200 |
commit | d07f2fbd7f615707c5f8b4bde32d5824c4196411 (patch) | |
tree | 471dd4e02088750aeb4adfab85a3c74b5052c1fc /plumbing/protocol/packp/updreq_encode.go | |
parent | a9899594dfdde8bbfdf35fc7e8c2fc3ec5aa7fdb (diff) | |
download | go-git-d07f2fbd7f615707c5f8b4bde32d5824c4196411.tar.gz |
Use only one name for receiver
Diffstat (limited to 'plumbing/protocol/packp/updreq_encode.go')
-rw-r--r-- | plumbing/protocol/packp/updreq_encode.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plumbing/protocol/packp/updreq_encode.go b/plumbing/protocol/packp/updreq_encode.go index 6a79653..2545e93 100644 --- a/plumbing/protocol/packp/updreq_encode.go +++ b/plumbing/protocol/packp/updreq_encode.go @@ -14,33 +14,33 @@ var ( ) // Encode writes the ReferenceUpdateRequest encoding to the stream. -func (r *ReferenceUpdateRequest) Encode(w io.Writer) error { - if err := r.validate(); err != nil { +func (req *ReferenceUpdateRequest) Encode(w io.Writer) error { + if err := req.validate(); err != nil { return err } e := pktline.NewEncoder(w) - if err := r.encodeShallow(e, r.Shallow); err != nil { + if err := req.encodeShallow(e, req.Shallow); err != nil { return err } - if err := r.encodeCommands(e, r.Commands, r.Capabilities); err != nil { + if err := req.encodeCommands(e, req.Commands, req.Capabilities); err != nil { return err } - if r.Packfile != nil { - if _, err := io.Copy(w, r.Packfile); err != nil { + if req.Packfile != nil { + if _, err := io.Copy(w, req.Packfile); err != nil { return err } - return r.Packfile.Close() + return req.Packfile.Close() } return nil } -func (r *ReferenceUpdateRequest) encodeShallow(e *pktline.Encoder, +func (req *ReferenceUpdateRequest) encodeShallow(e *pktline.Encoder, h *plumbing.Hash) error { if h == nil { @@ -51,7 +51,7 @@ func (r *ReferenceUpdateRequest) encodeShallow(e *pktline.Encoder, return e.Encodef("%s%s", shallow, objId) } -func (r *ReferenceUpdateRequest) encodeCommands(e *pktline.Encoder, +func (req *ReferenceUpdateRequest) encodeCommands(e *pktline.Encoder, cmds []*Command, cap *capability.List) error { if err := e.Encodef("%s\x00%s", |