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

*: fix typos in comments, variables and function names #1231

Merged
merged 1 commit into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _examples/ls-remote/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func main() {

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

// We can then use every Remote functions to retrieve wanted informations
// We can then use every Remote functions to retrieve wanted information
refs, err := rem.List(&git.ListOptions{})
if err != nil {
log.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions _examples/merge_base/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func checkIfError(err error, code exitCode, mainReason string, v ...interface{})
return
}

printErr(wrappErr(err, mainReason, v...))
printErr(wrapErr(err, mainReason, v...))
os.Exit(int(code))
}

Expand Down Expand Up @@ -52,7 +52,7 @@ func printCommits(commits []*object.Commit) {
}
}

func wrappErr(err error, s string, v ...interface{}) error {
func wrapErr(err error, s string, v ...interface{}) error {
if err != nil {
return fmt.Errorf("%s\n %s", fmt.Sprintf(s, v...), err)
}
Expand Down
2 changes: 1 addition & 1 deletion _examples/progress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {

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

Expand Down
2 changes: 1 addition & 1 deletion _examples/tag/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func main() {
CheckArgs("<path>")
path := os.Args[1]

// We instanciate a new repository targeting the given path (the .git folder)
// We instantiate a new repository targeting the given path (the .git folder)
r, err := git.PlainOpen(path)
CheckIfError(err)

Expand Down
4 changes: 2 additions & 2 deletions config/branch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (b *BranchSuite) TestValidateMerge(c *C) {
c.Assert(badBranch.Validate(), NotNil)
}

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

func (b *BranchSuite) TestUnmarshall(c *C) {
func (b *BranchSuite) TestUnmarshal(c *C) {
input := []byte(`[core]
bare = false
[branch "branch-tracking-on-clone"]
Expand Down
6 changes: 3 additions & 3 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type ConfigSuite struct{}

var _ = Suite(&ConfigSuite{})

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

func (s *ConfigSuite) TestMarshall(c *C) {
func (s *ConfigSuite) TestMarshal(c *C) {
output := []byte(`[core]
bare = true
worktree = bar
Expand Down Expand Up @@ -119,7 +119,7 @@ func (s *ConfigSuite) TestMarshall(c *C) {
c.Assert(string(b), Equals, string(output))
}

func (s *ConfigSuite) TestUnmarshallMarshall(c *C) {
func (s *ConfigSuite) TestUnmarshalMarshal(c *C) {
input := []byte(`[core]
bare = true
worktree = foo
Expand Down
6 changes: 3 additions & 3 deletions config/modules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *ModulesSuite) TestValidateMissingName(c *C) {
c.Assert(m.Validate(), Equals, ErrModuleEmptyPath)
}

func (s *ModulesSuite) TestMarshall(c *C) {
func (s *ModulesSuite) TestMarshal(c *C) {
input := []byte(`[submodule "qux"]
path = qux
url = baz
Expand All @@ -54,7 +54,7 @@ func (s *ModulesSuite) TestMarshall(c *C) {
c.Assert(output, DeepEquals, input)
}

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

func (s *ModulesSuite) TestUnmarshallMarshall(c *C) {
func (s *ModulesSuite) TestUnmarshalMarshal(c *C) {
input := []byte(`[submodule "foo/bar"]
path = foo/bar
url = https://github.com/foo/bar.git
Expand Down
2 changes: 1 addition & 1 deletion internal/revision/parser.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package revision extracts git revision from string
// More informations about revision : https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html
// More information about revision : https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html
package revision

import (
Expand Down
2 changes: 1 addition & 1 deletion internal/revision/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (s *ParserSuite) TestParseRefWithValidName(c *C) {
}
}

func (s *ParserSuite) TestParseRefWithUnvalidName(c *C) {
func (s *ParserSuite) TestParseRefWithInvalidName(c *C) {
datas := map[string]error{
".master": &ErrInvalidRevision{`must not start with "."`},
"/master": &ErrInvalidRevision{`must not start with "/"`},
Expand Down
2 changes: 1 addition & 1 deletion internal/revision/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// validates it belongs to a rune category
type runeCategoryValidator func(r rune) bool

// tokenizeExpression aggegates a series of runes matching check predicate into a single
// tokenizeExpression aggregates a series of runes matching check predicate into a single
// string and provides given tokenType as token type
func tokenizeExpression(ch rune, tokenType token, check runeCategoryValidator, r *bufio.Reader) (token, string, error) {
var data []rune
Expand Down
2 changes: 1 addition & 1 deletion object_walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func newObjectWalker(s storage.Storer) *objectWalker {
return &objectWalker{s, map[plumbing.Hash]struct{}{}}
}

// walkAllRefs walks all (hash) refererences from the repo.
// walkAllRefs walks all (hash) references from the repo.
func (p *objectWalker) walkAllRefs() error {
// Walk over all the references in the repo.
it, err := p.Storer.IterReferences()
Expand Down
6 changes: 3 additions & 3 deletions plumbing/filemode/filemode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ||
Expand Down
2 changes: 1 addition & 1 deletion plumbing/filemode/filemode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.*",
Expand Down
2 changes: 1 addition & 1 deletion plumbing/format/idxfile/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down
2 changes: 1 addition & 1 deletion plumbing/format/index/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions plumbing/format/index/encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}},
Expand All @@ -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}},
Expand Down
2 changes: 1 addition & 1 deletion plumbing/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
)

// Hash SHA1 hased content
// Hash SHA1 hashed content
type Hash [20]byte

// ZeroHash is Hash with value zero
Expand Down
8 changes: 4 additions & 4 deletions plumbing/object/commit_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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: "[email protected]", When: time.Now()},
}
Expand Down
4 changes: 2 additions & 2 deletions plumbing/object/commit_walker_bfs_filtered.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions plumbing/object/merge_base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------
Expand Down
4 changes: 2 additions & 2 deletions plumbing/protocol/packp/advrefs_decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions plumbing/protocol/packp/capability/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plumbing/protocol/packp/capability/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions plumbing/protocol/packp/ulreq.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions plumbing/protocol/packp/ulreq_encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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[:]) {
Expand Down
Loading