aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
authorOleksandr Redko <oleksandr.red+github@gmail.com>2019-10-24 23:33:57 +0300
committerOleksandr Redko <oleksandr.red+github@gmail.com>2019-10-24 23:37:27 +0300
commit81627ab53e269a762b769b47c004cb4309452492 (patch)
treecc7274d6f63f02112d407f9d0da5ddbc5ea2eaa1 /plumbing
parentaac20cc0e86f9f563bc74c42e9b9c598dfe271da (diff)
downloadgo-git-81627ab53e269a762b769b47c004cb4309452492.tar.gz
Fix typos in comments, variables and function names
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/filemode/filemode.go6
-rw-r--r--plumbing/filemode/filemode_test.go2
-rw-r--r--plumbing/format/idxfile/decoder.go2
-rw-r--r--plumbing/format/index/decoder_test.go2
-rw-r--r--plumbing/format/index/encoder_test.go6
-rw-r--r--plumbing/hash.go2
-rw-r--r--plumbing/object/commit_stats_test.go8
-rw-r--r--plumbing/object/commit_walker_bfs_filtered.go4
-rw-r--r--plumbing/object/merge_base_test.go4
-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.go10
-rw-r--r--plumbing/protocol/packp/uppackreq.go4
-rw-r--r--plumbing/storer/object.go4
-rw-r--r--plumbing/transport/http/common.go2
-rw-r--r--plumbing/transport/internal/common/common.go2
-rw-r--r--plumbing/transport/internal/common/common_test.go2
20 files changed, 40 insertions, 40 deletions
diff --git a/plumbing/filemode/filemode.go b/plumbing/filemode/filemode.go
index 0994bc4..594984f 100644
--- a/plumbing/filemode/filemode.go
+++ b/plumbing/filemode/filemode.go
@@ -32,10 +32,10 @@ const (
Regular FileMode = 0100644
// Deprecated represent non-executable files with the group writable
// bit set. This mode was supported by the first versions of git,
- // but it has been deprecatred nowadays. This library uses them
+ // but it has been deprecated nowadays. This library uses them
// internally, so you can read old packfiles, but will treat them as
// Regulars when interfacing with the outside world. This is the
- // standard git behaviuor.
+ // standard git behaviour.
Deprecated FileMode = 0100664
// Executable represents executable files.
Executable FileMode = 0100755
@@ -152,7 +152,7 @@ func (m FileMode) IsRegular() bool {
}
// IsFile returns if the FileMode represents that of a file, this is,
-// Regular, Deprecated, Excutable or Link.
+// Regular, Deprecated, Executable or Link.
func (m FileMode) IsFile() bool {
return m == Regular ||
m == Deprecated ||
diff --git a/plumbing/filemode/filemode_test.go b/plumbing/filemode/filemode_test.go
index 299c96a..8d713f6 100644
--- a/plumbing/filemode/filemode_test.go
+++ b/plumbing/filemode/filemode_test.go
@@ -126,7 +126,7 @@ func (s *ModeSuite) TestNewFromOsFileModeExclusive(c *C) {
}
func (s *ModeSuite) TestNewFromOsFileModeTemporary(c *C) {
- // temporaty files are ignored
+ // temporary files are ignored
fixture{
input: os.FileMode(0644) | os.ModeTemporary, // Trw-r--r--
expected: Empty, err: "no equivalent.*",
diff --git a/plumbing/format/idxfile/decoder.go b/plumbing/format/idxfile/decoder.go
index 9e9c176..d1a8a2c 100644
--- a/plumbing/format/idxfile/decoder.go
+++ b/plumbing/format/idxfile/decoder.go
@@ -12,7 +12,7 @@ import (
var (
// ErrUnsupportedVersion is returned by Decode when the idx file version
// is not supported.
- ErrUnsupportedVersion = errors.New("Unsuported version")
+ ErrUnsupportedVersion = errors.New("Unsupported version")
// ErrMalformedIdxFile is returned by Decode when the idx file is corrupted.
ErrMalformedIdxFile = errors.New("Malformed IDX file")
)
diff --git a/plumbing/format/index/decoder_test.go b/plumbing/format/index/decoder_test.go
index 7468ad0..92d312d 100644
--- a/plumbing/format/index/decoder_test.go
+++ b/plumbing/format/index/decoder_test.go
@@ -115,7 +115,7 @@ func (s *IndexSuite) TestDecodeMergeConflict(c *C) {
{TheirMode, "14f8e368114f561c38e134f6e68ea6fea12d77ed"},
}
- // stagged files
+ // staged files
for i, e := range idx.Entries[4:7] {
c.Assert(e.Stage, Equals, expected[i].Stage)
c.Assert(e.CreatedAt.IsZero(), Equals, true)
diff --git a/plumbing/format/index/encoder_test.go b/plumbing/format/index/encoder_test.go
index 78cbbba..ea121fc 100644
--- a/plumbing/format/index/encoder_test.go
+++ b/plumbing/format/index/encoder_test.go
@@ -55,7 +55,7 @@ func (s *IndexSuite) TestEncode(c *C) {
}
-func (s *IndexSuite) TestEncodeUnsuportedVersion(c *C) {
+func (s *IndexSuite) TestEncodeUnsupportedVersion(c *C) {
idx := &Index{Version: 3}
buf := bytes.NewBuffer(nil)
@@ -64,7 +64,7 @@ func (s *IndexSuite) TestEncodeUnsuportedVersion(c *C) {
c.Assert(err, Equals, ErrUnsupportedVersion)
}
-func (s *IndexSuite) TestEncodeWithIntentToAddUnsuportedVersion(c *C) {
+func (s *IndexSuite) TestEncodeWithIntentToAddUnsupportedVersion(c *C) {
idx := &Index{
Version: 2,
Entries: []*Entry{{IntentToAdd: true}},
@@ -76,7 +76,7 @@ func (s *IndexSuite) TestEncodeWithIntentToAddUnsuportedVersion(c *C) {
c.Assert(err, Equals, ErrUnsupportedVersion)
}
-func (s *IndexSuite) TestEncodeWithSkipWorktreeUnsuportedVersion(c *C) {
+func (s *IndexSuite) TestEncodeWithSkipWorktreeUnsupportedVersion(c *C) {
idx := &Index{
Version: 2,
Entries: []*Entry{{SkipWorktree: true}},
diff --git a/plumbing/hash.go b/plumbing/hash.go
index 8e60877..637a425 100644
--- a/plumbing/hash.go
+++ b/plumbing/hash.go
@@ -9,7 +9,7 @@ import (
"strconv"
)
-// Hash SHA1 hased content
+// Hash SHA1 hashed content
type Hash [20]byte
// ZeroHash is Hash with value zero
diff --git a/plumbing/object/commit_stats_test.go b/plumbing/object/commit_stats_test.go
index 2fb3f08..dc9e4ad 100644
--- a/plumbing/object/commit_stats_test.go
+++ b/plumbing/object/commit_stats_test.go
@@ -22,7 +22,7 @@ type CommitStatsSuite struct {
var _ = Suite(&CommitStatsSuite{})
func (s *CommitStatsSuite) TestStats(c *C) {
- r, hash := s.writeHisotry(c, []byte("foo\n"), []byte("foo\nbar\n"))
+ r, hash := s.writeHistory(c, []byte("foo\n"), []byte("foo\nbar\n"))
aCommit, err := r.CommitObject(hash)
c.Assert(err, IsNil)
@@ -37,7 +37,7 @@ func (s *CommitStatsSuite) TestStats(c *C) {
}
func (s *CommitStatsSuite) TestStats_RootCommit(c *C) {
- r, hash := s.writeHisotry(c, []byte("foo\n"))
+ r, hash := s.writeHistory(c, []byte("foo\n"))
aCommit, err := r.CommitObject(hash)
c.Assert(err, IsNil)
@@ -53,7 +53,7 @@ func (s *CommitStatsSuite) TestStats_RootCommit(c *C) {
}
func (s *CommitStatsSuite) TestStats_WithoutNewLine(c *C) {
- r, hash := s.writeHisotry(c, []byte("foo\nbar"), []byte("foo\nbar\n"))
+ r, hash := s.writeHistory(c, []byte("foo\nbar"), []byte("foo\nbar\n"))
aCommit, err := r.CommitObject(hash)
c.Assert(err, IsNil)
@@ -67,7 +67,7 @@ func (s *CommitStatsSuite) TestStats_WithoutNewLine(c *C) {
c.Assert(fileStats[0].String(), Equals, " foo | 2 +-\n")
}
-func (s *CommitStatsSuite) writeHisotry(c *C, files ...[]byte) (*git.Repository, plumbing.Hash) {
+func (s *CommitStatsSuite) writeHistory(c *C, files ...[]byte) (*git.Repository, plumbing.Hash) {
cm := &git.CommitOptions{
Author: &object.Signature{Name: "Foo", Email: "foo@example.local", When: time.Now()},
}
diff --git a/plumbing/object/commit_walker_bfs_filtered.go b/plumbing/object/commit_walker_bfs_filtered.go
index b12523d..7b17f15 100644
--- a/plumbing/object/commit_walker_bfs_filtered.go
+++ b/plumbing/object/commit_walker_bfs_filtered.go
@@ -15,7 +15,7 @@ import (
// If the commit history can not be traversed, or the Close() method is called,
// the CommitIter won't return more commits.
// If no isValid is passed, all ancestors of from commit will be valid.
-// If no isLimit is limmit, all ancestors of all commits will be visited.
+// If no isLimit is limit, all ancestors of all commits will be visited.
func NewFilterCommitIter(
from *Commit,
isValid *CommitFilter,
@@ -50,7 +50,7 @@ func NewFilterCommitIter(
// CommitFilter returns a boolean for the passed Commit
type CommitFilter func(*Commit) bool
-// filterCommitIter implments CommitIter
+// filterCommitIter implements CommitIter
type filterCommitIter struct {
isValid CommitFilter
isLimit CommitFilter
diff --git a/plumbing/object/merge_base_test.go b/plumbing/object/merge_base_test.go
index 598539d..72c9cd9 100644
--- a/plumbing/object/merge_base_test.go
+++ b/plumbing/object/merge_base_test.go
@@ -48,8 +48,8 @@ candidates result
CD1, CD2, M, N CD1, CD2 M and N are reachable from CD2, so they're not
C, G, dev, M, N C, G, dev M and N are reachable from G, so they're not
C, D, M, N C, D M and N are reachable from C, so they're not
- A, A^, A, N, N^ A, N A^ and N^ are rechable from A and N
- A^^^, A^, A^^, A, N A, N A^^^, A^^ and A^ are rechable from A, so they're not
+ A, A^, A, N, N^ A, N A^ and N^ are reachable from A and N
+ A^^^, A^, A^^, A, N A, N A^^^, A^^ and A^ are reachable from A, so they're not
IsAncestor
----------------------------
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 51e8183..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))
}
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)
diff --git a/plumbing/storer/object.go b/plumbing/storer/object.go
index 98d1ec3..c84960a 100644
--- a/plumbing/storer/object.go
+++ b/plumbing/storer/object.go
@@ -141,7 +141,7 @@ func NewEncodedObjectLookupIter(
// Next returns the next object from the iterator. If the iterator has reached
// the end it will return io.EOF as an error. If the object can't be found in
// the object storage, it will return plumbing.ErrObjectNotFound as an error.
-// If the object is retreieved successfully error will be nil.
+// If the object is retrieved successfully error will be nil.
func (iter *EncodedObjectLookupIter) Next() (plumbing.EncodedObject, error) {
if iter.pos >= len(iter.series) {
return nil, io.EOF
@@ -187,7 +187,7 @@ func NewEncodedObjectSliceIter(series []plumbing.EncodedObject) *EncodedObjectSl
}
// Next returns the next object from the iterator. If the iterator has reached
-// the end it will return io.EOF as an error. If the object is retreieved
+// the end it will return io.EOF as an error. If the object is retrieved
// successfully error will be nil.
func (iter *EncodedObjectSliceIter) Next() (plumbing.EncodedObject, error) {
if len(iter.series) == 0 {
diff --git a/plumbing/transport/http/common.go b/plumbing/transport/http/common.go
index 38e903d..16ff930 100644
--- a/plumbing/transport/http/common.go
+++ b/plumbing/transport/http/common.go
@@ -84,7 +84,7 @@ var DefaultClient = NewClient(nil)
// Unless a properly initialized client is given, it will fall back into
// `http.DefaultClient`.
//
-// Note that for HTTP client cannot distinguist between private repositories and
+// Note that for HTTP client cannot distinguish between private repositories and
// unexistent repositories on GitHub. So it returns `ErrAuthorizationRequired`
// for both.
func NewClient(c *http.Client) transport.Transport {
diff --git a/plumbing/transport/internal/common/common.go b/plumbing/transport/internal/common/common.go
index 00497f3..cb1b6da 100644
--- a/plumbing/transport/internal/common/common.go
+++ b/plumbing/transport/internal/common/common.go
@@ -66,7 +66,7 @@ type Command interface {
Close() error
}
-// CommandKiller expands the Command interface, enableing it for being killed.
+// CommandKiller expands the Command interface, enabling it for being killed.
type CommandKiller interface {
// Kill and close the session whatever the state it is. It will block until
// the command is terminated.
diff --git a/plumbing/transport/internal/common/common_test.go b/plumbing/transport/internal/common/common_test.go
index b2f035d..c60ef3b 100644
--- a/plumbing/transport/internal/common/common_test.go
+++ b/plumbing/transport/internal/common/common_test.go
@@ -13,7 +13,7 @@ type CommonSuite struct{}
var _ = Suite(&CommonSuite{})
-func (s *CommonSuite) TestIsRepoNotFoundErrorForUnknowSource(c *C) {
+func (s *CommonSuite) TestIsRepoNotFoundErrorForUnknownSource(c *C) {
msg := "unknown system is complaining of something very sad :("
isRepoNotFound := isRepoNotFoundError(msg)