aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/commit.go
diff options
context:
space:
mode:
authorOleg Kovalov <iamolegkovalov@gmail.com>2020-07-06 16:50:56 +0200
committerOleg Kovalov <iamolegkovalov@gmail.com>2020-07-06 16:50:56 +0200
commitd07f2fbd7f615707c5f8b4bde32d5824c4196411 (patch)
tree471dd4e02088750aeb4adfab85a3c74b5052c1fc /plumbing/object/commit.go
parenta9899594dfdde8bbfdf35fc7e8c2fc3ec5aa7fdb (diff)
downloadgo-git-d07f2fbd7f615707c5f8b4bde32d5824c4196411.tar.gz
Use only one name for receiver
Diffstat (limited to 'plumbing/object/commit.go')
-rw-r--r--plumbing/object/commit.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/plumbing/object/commit.go b/plumbing/object/commit.go
index 113cb29..98664a1 100644
--- a/plumbing/object/commit.go
+++ b/plumbing/object/commit.go
@@ -243,16 +243,16 @@ func (c *Commit) Decode(o plumbing.EncodedObject) (err error) {
}
// Encode transforms a Commit into a plumbing.EncodedObject.
-func (b *Commit) Encode(o plumbing.EncodedObject) error {
- return b.encode(o, true)
+func (c *Commit) Encode(o plumbing.EncodedObject) error {
+ return c.encode(o, true)
}
// EncodeWithoutSignature export a Commit into a plumbing.EncodedObject without the signature (correspond to the payload of the PGP signature).
-func (b *Commit) EncodeWithoutSignature(o plumbing.EncodedObject) error {
- return b.encode(o, false)
+func (c *Commit) EncodeWithoutSignature(o plumbing.EncodedObject) error {
+ return c.encode(o, false)
}
-func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
+func (c *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
o.SetType(plumbing.CommitObject)
w, err := o.Writer()
if err != nil {
@@ -261,11 +261,11 @@ func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
defer ioutil.CheckClose(w, &err)
- if _, err = fmt.Fprintf(w, "tree %s\n", b.TreeHash.String()); err != nil {
+ if _, err = fmt.Fprintf(w, "tree %s\n", c.TreeHash.String()); err != nil {
return err
}
- for _, parent := range b.ParentHashes {
+ for _, parent := range c.ParentHashes {
if _, err = fmt.Fprintf(w, "parent %s\n", parent.String()); err != nil {
return err
}
@@ -275,7 +275,7 @@ func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
return err
}
- if err = b.Author.Encode(w); err != nil {
+ if err = c.Author.Encode(w); err != nil {
return err
}
@@ -283,11 +283,11 @@ func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
return err
}
- if err = b.Committer.Encode(w); err != nil {
+ if err = c.Committer.Encode(w); err != nil {
return err
}
- if b.PGPSignature != "" && includeSig {
+ if c.PGPSignature != "" && includeSig {
if _, err = fmt.Fprint(w, "\n"+headerpgp+" "); err != nil {
return err
}
@@ -296,14 +296,14 @@ func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
// newline. Use join for this so it's clear that a newline should not be
// added after this section, as it will be added when the message is
// printed.
- signature := strings.TrimSuffix(b.PGPSignature, "\n")
+ signature := strings.TrimSuffix(c.PGPSignature, "\n")
lines := strings.Split(signature, "\n")
if _, err = fmt.Fprint(w, strings.Join(lines, "\n ")); err != nil {
return err
}
}
- if _, err = fmt.Fprintf(w, "\n\n%s", b.Message); err != nil {
+ if _, err = fmt.Fprintf(w, "\n\n%s", c.Message); err != nil {
return err
}