@@ -243,16 +243,16 @@ func (c *Commit) Decode(o plumbing.EncodedObject) (err error) {
243
243
}
244
244
245
245
// Encode transforms a Commit into a plumbing.EncodedObject.
246
- func (b * Commit ) Encode (o plumbing.EncodedObject ) error {
247
- return b .encode (o , true )
246
+ func (c * Commit ) Encode (o plumbing.EncodedObject ) error {
247
+ return c .encode (o , true )
248
248
}
249
249
250
250
// EncodeWithoutSignature export a Commit into a plumbing.EncodedObject without the signature (correspond to the payload of the PGP signature).
251
- func (b * Commit ) EncodeWithoutSignature (o plumbing.EncodedObject ) error {
252
- return b .encode (o , false )
251
+ func (c * Commit ) EncodeWithoutSignature (o plumbing.EncodedObject ) error {
252
+ return c .encode (o , false )
253
253
}
254
254
255
- func (b * Commit ) encode (o plumbing.EncodedObject , includeSig bool ) (err error ) {
255
+ func (c * Commit ) encode (o plumbing.EncodedObject , includeSig bool ) (err error ) {
256
256
o .SetType (plumbing .CommitObject )
257
257
w , err := o .Writer ()
258
258
if err != nil {
@@ -261,11 +261,11 @@ func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
261
261
262
262
defer ioutil .CheckClose (w , & err )
263
263
264
- if _ , err = fmt .Fprintf (w , "tree %s\n " , b .TreeHash .String ()); err != nil {
264
+ if _ , err = fmt .Fprintf (w , "tree %s\n " , c .TreeHash .String ()); err != nil {
265
265
return err
266
266
}
267
267
268
- for _ , parent := range b .ParentHashes {
268
+ for _ , parent := range c .ParentHashes {
269
269
if _ , err = fmt .Fprintf (w , "parent %s\n " , parent .String ()); err != nil {
270
270
return err
271
271
}
@@ -275,19 +275,19 @@ func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
275
275
return err
276
276
}
277
277
278
- if err = b .Author .Encode (w ); err != nil {
278
+ if err = c .Author .Encode (w ); err != nil {
279
279
return err
280
280
}
281
281
282
282
if _ , err = fmt .Fprint (w , "\n committer " ); err != nil {
283
283
return err
284
284
}
285
285
286
- if err = b .Committer .Encode (w ); err != nil {
286
+ if err = c .Committer .Encode (w ); err != nil {
287
287
return err
288
288
}
289
289
290
- if b .PGPSignature != "" && includeSig {
290
+ if c .PGPSignature != "" && includeSig {
291
291
if _ , err = fmt .Fprint (w , "\n " + headerpgp + " " ); err != nil {
292
292
return err
293
293
}
@@ -296,14 +296,14 @@ func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
296
296
// newline. Use join for this so it's clear that a newline should not be
297
297
// added after this section, as it will be added when the message is
298
298
// printed.
299
- signature := strings .TrimSuffix (b .PGPSignature , "\n " )
299
+ signature := strings .TrimSuffix (c .PGPSignature , "\n " )
300
300
lines := strings .Split (signature , "\n " )
301
301
if _ , err = fmt .Fprint (w , strings .Join (lines , "\n " )); err != nil {
302
302
return err
303
303
}
304
304
}
305
305
306
- if _ , err = fmt .Fprintf (w , "\n \n %s" , b .Message ); err != nil {
306
+ if _ , err = fmt .Fprintf (w , "\n \n %s" , c .Message ); err != nil {
307
307
return err
308
308
}
309
309
0 commit comments