Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 1a7db85

Browse files
authored
Merge pull request #1231 from alexandear/fix-typos
*: fix typos in comments, variables and function names
2 parents 3895dfa + 81627ab commit 1a7db85

38 files changed

+70
-70
lines changed

_examples/ls-remote/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919

2020
log.Print("Fetching tags...")
2121

22-
// We can then use every Remote functions to retrieve wanted informations
22+
// We can then use every Remote functions to retrieve wanted information
2323
refs, err := rem.List(&git.ListOptions{})
2424
if err != nil {
2525
log.Fatal(err)

_examples/merge_base/helpers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func checkIfError(err error, code exitCode, mainReason string, v ...interface{})
1313
return
1414
}
1515

16-
printErr(wrappErr(err, mainReason, v...))
16+
printErr(wrapErr(err, mainReason, v...))
1717
os.Exit(int(code))
1818
}
1919

@@ -52,7 +52,7 @@ func printCommits(commits []*object.Commit) {
5252
}
5353
}
5454

55-
func wrappErr(err error, s string, v ...interface{}) error {
55+
func wrapErr(err error, s string, v ...interface{}) error {
5656
if err != nil {
5757
return fmt.Errorf("%s\n %s", fmt.Sprintf(s, v...), err)
5858
}

_examples/progress/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func main() {
2222

2323
// as git does, when you make a clone, pull or some other operations the
2424
// server sends information via the sideband, this information can being
25-
// collected provinding a io.Writer to the CloneOptions options
25+
// collected providing a io.Writer to the CloneOptions options
2626
Progress: os.Stdout,
2727
})
2828

_examples/tag/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func main() {
1515
CheckArgs("<path>")
1616
path := os.Args[1]
1717

18-
// We instanciate a new repository targeting the given path (the .git folder)
18+
// We instantiate a new repository targeting the given path (the .git folder)
1919
r, err := git.PlainOpen(path)
2020
CheckIfError(err)
2121

config/branch_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (b *BranchSuite) TestValidateMerge(c *C) {
3838
c.Assert(badBranch.Validate(), NotNil)
3939
}
4040

41-
func (b *BranchSuite) TestMarshall(c *C) {
41+
func (b *BranchSuite) TestMarshal(c *C) {
4242
expected := []byte(`[core]
4343
bare = false
4444
[branch "branch-tracking-on-clone"]
@@ -60,7 +60,7 @@ func (b *BranchSuite) TestMarshall(c *C) {
6060
c.Assert(string(actual), Equals, string(expected))
6161
}
6262

63-
func (b *BranchSuite) TestUnmarshall(c *C) {
63+
func (b *BranchSuite) TestUnmarshal(c *C) {
6464
input := []byte(`[core]
6565
bare = false
6666
[branch "branch-tracking-on-clone"]

config/config_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type ConfigSuite struct{}
99

1010
var _ = Suite(&ConfigSuite{})
1111

12-
func (s *ConfigSuite) TestUnmarshall(c *C) {
12+
func (s *ConfigSuite) TestUnmarshal(c *C) {
1313
input := []byte(`[core]
1414
bare = true
1515
worktree = foo
@@ -60,7 +60,7 @@ func (s *ConfigSuite) TestUnmarshall(c *C) {
6060
c.Assert(cfg.Branches["master"].Merge, Equals, plumbing.ReferenceName("refs/heads/master"))
6161
}
6262

63-
func (s *ConfigSuite) TestMarshall(c *C) {
63+
func (s *ConfigSuite) TestMarshal(c *C) {
6464
output := []byte(`[core]
6565
bare = true
6666
worktree = bar
@@ -119,7 +119,7 @@ func (s *ConfigSuite) TestMarshall(c *C) {
119119
c.Assert(string(b), Equals, string(output))
120120
}
121121

122-
func (s *ConfigSuite) TestUnmarshallMarshall(c *C) {
122+
func (s *ConfigSuite) TestUnmarshalMarshal(c *C) {
123123
input := []byte(`[core]
124124
bare = true
125125
worktree = foo

config/modules_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (s *ModulesSuite) TestValidateMissingName(c *C) {
3939
c.Assert(m.Validate(), Equals, ErrModuleEmptyPath)
4040
}
4141

42-
func (s *ModulesSuite) TestMarshall(c *C) {
42+
func (s *ModulesSuite) TestMarshal(c *C) {
4343
input := []byte(`[submodule "qux"]
4444
path = qux
4545
url = baz
@@ -54,7 +54,7 @@ func (s *ModulesSuite) TestMarshall(c *C) {
5454
c.Assert(output, DeepEquals, input)
5555
}
5656

57-
func (s *ModulesSuite) TestUnmarshall(c *C) {
57+
func (s *ModulesSuite) TestUnmarshal(c *C) {
5858
input := []byte(`[submodule "qux"]
5959
path = qux
6060
url = https://github.com/foo/qux.git
@@ -79,7 +79,7 @@ func (s *ModulesSuite) TestUnmarshall(c *C) {
7979
c.Assert(cfg.Submodules["foo/bar"].Branch, Equals, "dev")
8080
}
8181

82-
func (s *ModulesSuite) TestUnmarshallMarshall(c *C) {
82+
func (s *ModulesSuite) TestUnmarshalMarshal(c *C) {
8383
input := []byte(`[submodule "foo/bar"]
8484
path = foo/bar
8585
url = https://github.com/foo/bar.git

internal/revision/parser.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Package revision extracts git revision from string
2-
// More informations about revision : https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html
2+
// More information about revision : https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html
33
package revision
44

55
import (

internal/revision/parser_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ func (s *ParserSuite) TestParseRefWithValidName(c *C) {
366366
}
367367
}
368368

369-
func (s *ParserSuite) TestParseRefWithUnvalidName(c *C) {
369+
func (s *ParserSuite) TestParseRefWithInvalidName(c *C) {
370370
datas := map[string]error{
371371
".master": &ErrInvalidRevision{`must not start with "."`},
372372
"/master": &ErrInvalidRevision{`must not start with "/"`},

internal/revision/scanner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
// validates it belongs to a rune category
1111
type runeCategoryValidator func(r rune) bool
1212

13-
// tokenizeExpression aggegates a series of runes matching check predicate into a single
13+
// tokenizeExpression aggregates a series of runes matching check predicate into a single
1414
// string and provides given tokenType as token type
1515
func tokenizeExpression(ch rune, tokenType token, check runeCategoryValidator, r *bufio.Reader) (token, string, error) {
1616
var data []rune

object_walker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func newObjectWalker(s storage.Storer) *objectWalker {
2121
return &objectWalker{s, map[plumbing.Hash]struct{}{}}
2222
}
2323

24-
// walkAllRefs walks all (hash) refererences from the repo.
24+
// walkAllRefs walks all (hash) references from the repo.
2525
func (p *objectWalker) walkAllRefs() error {
2626
// Walk over all the references in the repo.
2727
it, err := p.Storer.IterReferences()

plumbing/filemode/filemode.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ const (
3232
Regular FileMode = 0100644
3333
// Deprecated represent non-executable files with the group writable
3434
// bit set. This mode was supported by the first versions of git,
35-
// but it has been deprecatred nowadays. This library uses them
35+
// but it has been deprecated nowadays. This library uses them
3636
// internally, so you can read old packfiles, but will treat them as
3737
// Regulars when interfacing with the outside world. This is the
38-
// standard git behaviuor.
38+
// standard git behaviour.
3939
Deprecated FileMode = 0100664
4040
// Executable represents executable files.
4141
Executable FileMode = 0100755
@@ -152,7 +152,7 @@ func (m FileMode) IsRegular() bool {
152152
}
153153

154154
// IsFile returns if the FileMode represents that of a file, this is,
155-
// Regular, Deprecated, Excutable or Link.
155+
// Regular, Deprecated, Executable or Link.
156156
func (m FileMode) IsFile() bool {
157157
return m == Regular ||
158158
m == Deprecated ||

plumbing/filemode/filemode_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (s *ModeSuite) TestNewFromOsFileModeExclusive(c *C) {
126126
}
127127

128128
func (s *ModeSuite) TestNewFromOsFileModeTemporary(c *C) {
129-
// temporaty files are ignored
129+
// temporary files are ignored
130130
fixture{
131131
input: os.FileMode(0644) | os.ModeTemporary, // Trw-r--r--
132132
expected: Empty, err: "no equivalent.*",

plumbing/format/idxfile/decoder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
var (
1313
// ErrUnsupportedVersion is returned by Decode when the idx file version
1414
// is not supported.
15-
ErrUnsupportedVersion = errors.New("Unsuported version")
15+
ErrUnsupportedVersion = errors.New("Unsupported version")
1616
// ErrMalformedIdxFile is returned by Decode when the idx file is corrupted.
1717
ErrMalformedIdxFile = errors.New("Malformed IDX file")
1818
)

plumbing/format/index/decoder_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (s *IndexSuite) TestDecodeMergeConflict(c *C) {
115115
{TheirMode, "14f8e368114f561c38e134f6e68ea6fea12d77ed"},
116116
}
117117

118-
// stagged files
118+
// staged files
119119
for i, e := range idx.Entries[4:7] {
120120
c.Assert(e.Stage, Equals, expected[i].Stage)
121121
c.Assert(e.CreatedAt.IsZero(), Equals, true)

plumbing/format/index/encoder_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (s *IndexSuite) TestEncode(c *C) {
5555

5656
}
5757

58-
func (s *IndexSuite) TestEncodeUnsuportedVersion(c *C) {
58+
func (s *IndexSuite) TestEncodeUnsupportedVersion(c *C) {
5959
idx := &Index{Version: 3}
6060

6161
buf := bytes.NewBuffer(nil)
@@ -64,7 +64,7 @@ func (s *IndexSuite) TestEncodeUnsuportedVersion(c *C) {
6464
c.Assert(err, Equals, ErrUnsupportedVersion)
6565
}
6666

67-
func (s *IndexSuite) TestEncodeWithIntentToAddUnsuportedVersion(c *C) {
67+
func (s *IndexSuite) TestEncodeWithIntentToAddUnsupportedVersion(c *C) {
6868
idx := &Index{
6969
Version: 2,
7070
Entries: []*Entry{{IntentToAdd: true}},
@@ -76,7 +76,7 @@ func (s *IndexSuite) TestEncodeWithIntentToAddUnsuportedVersion(c *C) {
7676
c.Assert(err, Equals, ErrUnsupportedVersion)
7777
}
7878

79-
func (s *IndexSuite) TestEncodeWithSkipWorktreeUnsuportedVersion(c *C) {
79+
func (s *IndexSuite) TestEncodeWithSkipWorktreeUnsupportedVersion(c *C) {
8080
idx := &Index{
8181
Version: 2,
8282
Entries: []*Entry{{SkipWorktree: true}},

plumbing/hash.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strconv"
1010
)
1111

12-
// Hash SHA1 hased content
12+
// Hash SHA1 hashed content
1313
type Hash [20]byte
1414

1515
// ZeroHash is Hash with value zero

plumbing/object/commit_stats_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type CommitStatsSuite struct {
2222
var _ = Suite(&CommitStatsSuite{})
2323

2424
func (s *CommitStatsSuite) TestStats(c *C) {
25-
r, hash := s.writeHisotry(c, []byte("foo\n"), []byte("foo\nbar\n"))
25+
r, hash := s.writeHistory(c, []byte("foo\n"), []byte("foo\nbar\n"))
2626

2727
aCommit, err := r.CommitObject(hash)
2828
c.Assert(err, IsNil)
@@ -37,7 +37,7 @@ func (s *CommitStatsSuite) TestStats(c *C) {
3737
}
3838

3939
func (s *CommitStatsSuite) TestStats_RootCommit(c *C) {
40-
r, hash := s.writeHisotry(c, []byte("foo\n"))
40+
r, hash := s.writeHistory(c, []byte("foo\n"))
4141

4242
aCommit, err := r.CommitObject(hash)
4343
c.Assert(err, IsNil)
@@ -53,7 +53,7 @@ func (s *CommitStatsSuite) TestStats_RootCommit(c *C) {
5353
}
5454

5555
func (s *CommitStatsSuite) TestStats_WithoutNewLine(c *C) {
56-
r, hash := s.writeHisotry(c, []byte("foo\nbar"), []byte("foo\nbar\n"))
56+
r, hash := s.writeHistory(c, []byte("foo\nbar"), []byte("foo\nbar\n"))
5757

5858
aCommit, err := r.CommitObject(hash)
5959
c.Assert(err, IsNil)
@@ -67,7 +67,7 @@ func (s *CommitStatsSuite) TestStats_WithoutNewLine(c *C) {
6767
c.Assert(fileStats[0].String(), Equals, " foo | 2 +-\n")
6868
}
6969

70-
func (s *CommitStatsSuite) writeHisotry(c *C, files ...[]byte) (*git.Repository, plumbing.Hash) {
70+
func (s *CommitStatsSuite) writeHistory(c *C, files ...[]byte) (*git.Repository, plumbing.Hash) {
7171
cm := &git.CommitOptions{
7272
Author: &object.Signature{Name: "Foo", Email: "[email protected]", When: time.Now()},
7373
}

plumbing/object/commit_walker_bfs_filtered.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// If the commit history can not be traversed, or the Close() method is called,
1616
// the CommitIter won't return more commits.
1717
// If no isValid is passed, all ancestors of from commit will be valid.
18-
// If no isLimit is limmit, all ancestors of all commits will be visited.
18+
// If no isLimit is limit, all ancestors of all commits will be visited.
1919
func NewFilterCommitIter(
2020
from *Commit,
2121
isValid *CommitFilter,
@@ -50,7 +50,7 @@ func NewFilterCommitIter(
5050
// CommitFilter returns a boolean for the passed Commit
5151
type CommitFilter func(*Commit) bool
5252

53-
// filterCommitIter implments CommitIter
53+
// filterCommitIter implements CommitIter
5454
type filterCommitIter struct {
5555
isValid CommitFilter
5656
isLimit CommitFilter

plumbing/object/merge_base_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ candidates result
4848
CD1, CD2, M, N CD1, CD2 M and N are reachable from CD2, so they're not
4949
C, G, dev, M, N C, G, dev M and N are reachable from G, so they're not
5050
C, D, M, N C, D M and N are reachable from C, so they're not
51-
A, A^, A, N, N^ A, N A^ and N^ are rechable from A and N
52-
A^^^, A^, A^^, A, N A, N A^^^, A^^ and A^ are rechable from A, so they're not
51+
A, A^, A, N, N^ A, N A^ and N^ are reachable from A and N
52+
A^^^, A^, A^^, A, N A, N A^^^, A^^ and A^ are reachable from A, so they're not
5353
5454
IsAncestor
5555
----------------------------

plumbing/protocol/packp/advrefs_decode.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (d *advRefsDecoder) Decode(v *AdvRefs) error {
5353

5454
type decoderStateFn func(*advRefsDecoder) decoderStateFn
5555

56-
// fills out the parser stiky error
56+
// fills out the parser sticky error
5757
func (d *advRefsDecoder) error(format string, a ...interface{}) {
5858
msg := fmt.Sprintf(
5959
"pkt-line %d: %s", d.nLine,
@@ -281,7 +281,7 @@ func decodeShallow(p *advRefsDecoder) decoderStateFn {
281281
}
282282

283283
if len(p.line) == 0 {
284-
return nil // succesfull parse of the advertised-refs message
284+
return nil // successful parse of the advertised-refs message
285285
}
286286

287287
return decodeShallow

plumbing/protocol/packp/capability/list.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var (
1414
// ErrArguments is returned if arguments are given with a capabilities that
1515
// not supports arguments
1616
ErrArguments = errors.New("arguments not allowed")
17-
// ErrEmtpyArgument is returned when an empty value is given
18-
ErrEmtpyArgument = errors.New("empty argument")
17+
// ErrEmptyArgument is returned when an empty value is given
18+
ErrEmptyArgument = errors.New("empty argument")
1919
// ErrMultipleArguments multiple argument given to a capabilities that not
2020
// support it
2121
ErrMultipleArguments = errors.New("multiple arguments not allowed")
@@ -119,7 +119,7 @@ func (l *List) Add(c Capability, values ...string) error {
119119
func (l *List) validateNoEmptyArgs(values []string) error {
120120
for _, v := range values {
121121
if v == "" {
122-
return ErrEmtpyArgument
122+
return ErrEmptyArgument
123123
}
124124
}
125125
return nil

plumbing/protocol/packp/capability/list_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (s *SuiteCapabilities) TestAddErrArgumentsNotAllowed(c *check.C) {
176176
func (s *SuiteCapabilities) TestAddErrArguments(c *check.C) {
177177
cap := NewList()
178178
err := cap.Add(SymRef, "")
179-
c.Assert(err, check.Equals, ErrEmtpyArgument)
179+
c.Assert(err, check.Equals, ErrEmptyArgument)
180180
}
181181

182182
func (s *SuiteCapabilities) TestAddErrMultipleArguments(c *check.C) {

plumbing/protocol/packp/ulreq.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ func NewUploadRequest() *UploadRequest {
6868
}
6969

7070
// NewUploadRequestFromCapabilities returns a pointer to a new UploadRequest
71-
// value, the request capabilities are filled with the most optiomal ones, based
72-
// on the adv value (advertaised capabilities), the UploadRequest generated it
71+
// value, the request capabilities are filled with the most optimal ones, based
72+
// on the adv value (advertised capabilities), the UploadRequest generated it
7373
// has no wants or shallows and an infinite depth.
7474
func NewUploadRequestFromCapabilities(adv *capability.List) *UploadRequest {
7575
r := NewUploadRequest()

plumbing/protocol/packp/ulreq_encode.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ func (e *ulReqEncoder) encodeFirstWant() stateFn {
6464
return nil
6565
}
6666

67-
return e.encodeAditionalWants
67+
return e.encodeAdditionalWants
6868
}
6969

70-
func (e *ulReqEncoder) encodeAditionalWants() stateFn {
70+
func (e *ulReqEncoder) encodeAdditionalWants() stateFn {
7171
last := e.data.Wants[0]
7272
for _, w := range e.data.Wants[1:] {
7373
if bytes.Equal(last[:], w[:]) {

0 commit comments

Comments
 (0)