diff options
author | Paulo Gomes <pjbgf@linux.com> | 2024-01-16 23:31:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-16 23:31:05 +0000 |
commit | 427a6ea74aa6992f950a731e331699bf0bff6eea (patch) | |
tree | c730999de700c73b6e4a00cd507e3f5b6a7beb83 | |
parent | 51598381730654f6a98ceb5b1604e619bf4afc03 (diff) | |
parent | 90498b3becf13415bd1275f59c807340080f9e41 (diff) | |
download | go-git-427a6ea74aa6992f950a731e331699bf0bff6eea.tar.gz |
Merge pull request #987 from Jerry-yz/master
object: fix variable defaultUtf8CommitMessageEncoding name spell error
-rw-r--r-- | plumbing/object/commit.go | 6 | ||||
-rw-r--r-- | plumbing/object/commit_test.go | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plumbing/object/commit.go b/plumbing/object/commit.go index ceed5d0..3d096e1 100644 --- a/plumbing/object/commit.go +++ b/plumbing/object/commit.go @@ -27,7 +27,7 @@ const ( // the commit with the "mergetag" header. headermergetag string = "mergetag" - defaultUtf8CommitMesageEncoding MessageEncoding = "UTF-8" + defaultUtf8CommitMessageEncoding MessageEncoding = "UTF-8" ) // Hash represents the hash of an object @@ -189,7 +189,7 @@ func (c *Commit) Decode(o plumbing.EncodedObject) (err error) { } c.Hash = o.Hash() - c.Encoding = defaultUtf8CommitMesageEncoding + c.Encoding = defaultUtf8CommitMessageEncoding reader, err := o.Reader() if err != nil { @@ -335,7 +335,7 @@ func (c *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) { } } - if string(c.Encoding) != "" && c.Encoding != defaultUtf8CommitMesageEncoding { + if string(c.Encoding) != "" && c.Encoding != defaultUtf8CommitMessageEncoding { if _, err = fmt.Fprintf(w, "\n%s %s", headerencoding, c.Encoding); err != nil { return err } diff --git a/plumbing/object/commit_test.go b/plumbing/object/commit_test.go index 3e1fe1b..6651ef8 100644 --- a/plumbing/object/commit_test.go +++ b/plumbing/object/commit_test.go @@ -228,7 +228,7 @@ change Message: "Message\n\nFoo\nBar\nWith trailing blank lines\n\n", TreeHash: plumbing.NewHash("f000000000000000000000000000000000000001"), ParentHashes: []plumbing.Hash{plumbing.NewHash("f000000000000000000000000000000000000002")}, - Encoding: defaultUtf8CommitMesageEncoding, + Encoding: defaultUtf8CommitMessageEncoding, }, { Author: Signature{Name: "Foo", Email: "foo@example.local", When: ts}, @@ -253,7 +253,7 @@ change plumbing.NewHash("f000000000000000000000000000000000000003"), }, MergeTag: tag, - Encoding: defaultUtf8CommitMesageEncoding, + Encoding: defaultUtf8CommitMessageEncoding, }, { Author: Signature{Name: "Foo", Email: "foo@example.local", When: ts}, @@ -266,7 +266,7 @@ change }, MergeTag: tag, PGPSignature: pgpsignature, - Encoding: defaultUtf8CommitMesageEncoding, + Encoding: defaultUtf8CommitMessageEncoding, }, } for _, commit := range commits { |