diff options
Diffstat (limited to 'plumbing/protocol/packp/srvresp.go')
-rw-r--r-- | plumbing/protocol/packp/srvresp.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plumbing/protocol/packp/srvresp.go b/plumbing/protocol/packp/srvresp.go index b214341..6a91991 100644 --- a/plumbing/protocol/packp/srvresp.go +++ b/plumbing/protocol/packp/srvresp.go @@ -35,8 +35,8 @@ func (r *ServerResponse) Decode(reader *bufio.Reader, isMultiACK bool) error { return err } - // we need to detect when the end of a response header and the begining - // of a packfile header happend, some requests to the git daemon + // we need to detect when the end of a response header and the beginning + // of a packfile header happened, some requests to the git daemon // produces a duplicate ACK header even when multi_ack is not supported. stop, err := r.stopReading(reader) if err != nil { @@ -77,7 +77,7 @@ func (r *ServerResponse) stopReading(reader *bufio.Reader) (bool, error) { func (r *ServerResponse) isValidCommand(b []byte) bool { commands := [][]byte{ack, nak} for _, c := range commands { - if bytes.Compare(b, c) == 0 { + if bytes.Equal(b, c) { return true } } @@ -90,11 +90,11 @@ func (r *ServerResponse) decodeLine(line []byte) error { return fmt.Errorf("unexpected flush") } - if bytes.Compare(line[0:3], ack) == 0 { + if bytes.Equal(line[0:3], ack) { return r.decodeACKLine(line) } - if bytes.Compare(line[0:3], nak) == 0 { + if bytes.Equal(line[0:3], nak) { return nil } |