aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/protocol/packp')
-rw-r--r--plumbing/protocol/packp/advrefs.go2
-rw-r--r--plumbing/protocol/packp/advrefs_decode.go4
-rw-r--r--plumbing/protocol/packp/capability/list.go6
-rw-r--r--plumbing/protocol/packp/capability/list_test.go2
-rw-r--r--plumbing/protocol/packp/ulreq.go4
-rw-r--r--plumbing/protocol/packp/ulreq_encode.go4
-rw-r--r--plumbing/protocol/packp/updreq_decode.go12
-rw-r--r--plumbing/protocol/packp/uppackreq.go4
8 files changed, 19 insertions, 19 deletions
diff --git a/plumbing/protocol/packp/advrefs.go b/plumbing/protocol/packp/advrefs.go
index 684e76a..487ee19 100644
--- a/plumbing/protocol/packp/advrefs.go
+++ b/plumbing/protocol/packp/advrefs.go
@@ -107,7 +107,7 @@ func (a *AdvRefs) resolveHead(s storer.ReferenceStorer) error {
return nil
}
- ref, err := s.Reference(plumbing.ReferenceName(plumbing.Master))
+ ref, err := s.Reference(plumbing.Master)
// check first if HEAD is pointing to master
if err == nil {
diff --git a/plumbing/protocol/packp/advrefs_decode.go b/plumbing/protocol/packp/advrefs_decode.go
index 1b4c62c..80f5b4e 100644
--- a/plumbing/protocol/packp/advrefs_decode.go
+++ b/plumbing/protocol/packp/advrefs_decode.go
@@ -53,7 +53,7 @@ func (d *advRefsDecoder) Decode(v *AdvRefs) error {
type decoderStateFn func(*advRefsDecoder) decoderStateFn
-// fills out the parser stiky error
+// fills out the parser sticky error
func (d *advRefsDecoder) error(format string, a ...interface{}) {
msg := fmt.Sprintf(
"pkt-line %d: %s", d.nLine,
@@ -281,7 +281,7 @@ func decodeShallow(p *advRefsDecoder) decoderStateFn {
}
if len(p.line) == 0 {
- return nil // succesfull parse of the advertised-refs message
+ return nil // successful parse of the advertised-refs message
}
return decodeShallow
diff --git a/plumbing/protocol/packp/capability/list.go b/plumbing/protocol/packp/capability/list.go
index 26a79b6..9609211 100644
--- a/plumbing/protocol/packp/capability/list.go
+++ b/plumbing/protocol/packp/capability/list.go
@@ -14,8 +14,8 @@ var (
// ErrArguments is returned if arguments are given with a capabilities that
// not supports arguments
ErrArguments = errors.New("arguments not allowed")
- // ErrEmtpyArgument is returned when an empty value is given
- ErrEmtpyArgument = errors.New("empty argument")
+ // ErrEmptyArgument is returned when an empty value is given
+ ErrEmptyArgument = errors.New("empty argument")
// ErrMultipleArguments multiple argument given to a capabilities that not
// support it
ErrMultipleArguments = errors.New("multiple arguments not allowed")
@@ -119,7 +119,7 @@ func (l *List) Add(c Capability, values ...string) error {
func (l *List) validateNoEmptyArgs(values []string) error {
for _, v := range values {
if v == "" {
- return ErrEmtpyArgument
+ return ErrEmptyArgument
}
}
return nil
diff --git a/plumbing/protocol/packp/capability/list_test.go b/plumbing/protocol/packp/capability/list_test.go
index 82dd63f..61b0b13 100644
--- a/plumbing/protocol/packp/capability/list_test.go
+++ b/plumbing/protocol/packp/capability/list_test.go
@@ -176,7 +176,7 @@ func (s *SuiteCapabilities) TestAddErrArgumentsNotAllowed(c *check.C) {
func (s *SuiteCapabilities) TestAddErrArguments(c *check.C) {
cap := NewList()
err := cap.Add(SymRef, "")
- c.Assert(err, check.Equals, ErrEmtpyArgument)
+ c.Assert(err, check.Equals, ErrEmptyArgument)
}
func (s *SuiteCapabilities) TestAddErrMultipleArguments(c *check.C) {
diff --git a/plumbing/protocol/packp/ulreq.go b/plumbing/protocol/packp/ulreq.go
index 74109d8..72895e3 100644
--- a/plumbing/protocol/packp/ulreq.go
+++ b/plumbing/protocol/packp/ulreq.go
@@ -68,8 +68,8 @@ func NewUploadRequest() *UploadRequest {
}
// NewUploadRequestFromCapabilities returns a pointer to a new UploadRequest
-// value, the request capabilities are filled with the most optiomal ones, based
-// on the adv value (advertaised capabilities), the UploadRequest generated it
+// value, the request capabilities are filled with the most optimal ones, based
+// on the adv value (advertised capabilities), the UploadRequest generated it
// has no wants or shallows and an infinite depth.
func NewUploadRequestFromCapabilities(adv *capability.List) *UploadRequest {
r := NewUploadRequest()
diff --git a/plumbing/protocol/packp/ulreq_encode.go b/plumbing/protocol/packp/ulreq_encode.go
index 89a5986..dcfeb83 100644
--- a/plumbing/protocol/packp/ulreq_encode.go
+++ b/plumbing/protocol/packp/ulreq_encode.go
@@ -64,10 +64,10 @@ func (e *ulReqEncoder) encodeFirstWant() stateFn {
return nil
}
- return e.encodeAditionalWants
+ return e.encodeAdditionalWants
}
-func (e *ulReqEncoder) encodeAditionalWants() stateFn {
+func (e *ulReqEncoder) encodeAdditionalWants() stateFn {
last := e.data.Wants[0]
for _, w := range e.data.Wants[1:] {
if bytes.Equal(last[:], w[:]) {
diff --git a/plumbing/protocol/packp/updreq_decode.go b/plumbing/protocol/packp/updreq_decode.go
index c15d49c..59f095f 100644
--- a/plumbing/protocol/packp/updreq_decode.go
+++ b/plumbing/protocol/packp/updreq_decode.go
@@ -13,9 +13,9 @@ import (
)
var (
- shallowLineLength = len(shallow) + hashSize
- minCommandLength = hashSize*2 + 2 + 1
- minCommandAndCapsLenth = minCommandLength + 1
+ shallowLineLength = len(shallow) + hashSize
+ minCommandLength = hashSize*2 + 2 + 1
+ minCommandAndCapsLength = minCommandLength + 1
)
var (
@@ -46,7 +46,7 @@ func errInvalidShallowLineLength(got int) error {
func errInvalidCommandCapabilitiesLineLength(got int) error {
return errMalformedRequest(fmt.Sprintf(
"invalid command and capabilities line length: expected at least %d, got %d",
- minCommandAndCapsLenth, got))
+ minCommandAndCapsLength, got))
}
func errInvalidCommandLineLength(got int) error {
@@ -174,7 +174,7 @@ func (d *updReqDecoder) decodeCommandAndCapabilities() error {
return errMissingCapabilitiesDelimiter
}
- if len(b) < minCommandAndCapsLenth {
+ if len(b) < minCommandAndCapsLength {
return errInvalidCommandCapabilitiesLineLength(len(b))
}
@@ -225,7 +225,7 @@ func parseCommand(b []byte) (*Command, error) {
return nil, errInvalidNewObjId(err)
}
- return &Command{Old: oh, New: nh, Name: plumbing.ReferenceName(n)}, nil
+ return &Command{Old: oh, New: nh, Name: n}, nil
}
func parseHash(s string) (plumbing.Hash, error) {
diff --git a/plumbing/protocol/packp/uppackreq.go b/plumbing/protocol/packp/uppackreq.go
index 1144139..831ef8f 100644
--- a/plumbing/protocol/packp/uppackreq.go
+++ b/plumbing/protocol/packp/uppackreq.go
@@ -27,8 +27,8 @@ func NewUploadPackRequest() *UploadPackRequest {
}
// NewUploadPackRequestFromCapabilities creates a new UploadPackRequest and
-// returns a pointer. The request capabilities are filled with the most optiomal
-// ones, based on the adv value (advertaised capabilities), the UploadPackRequest
+// returns a pointer. The request capabilities are filled with the most optimal
+// ones, based on the adv value (advertised capabilities), the UploadPackRequest
// it has no wants, haves or shallows and an infinite depth
func NewUploadPackRequestFromCapabilities(adv *capability.List) *UploadPackRequest {
ur := NewUploadRequestFromCapabilities(adv)