@@ -33,8 +33,8 @@ type Commit struct {
33
33
// Committer is the one performing the commit, might be different from
34
34
// Author.
35
35
Committer Signature
36
- // GPGSignature is the GPG signature of the commit.
37
- GPGSignature string
36
+ // PGPSignature is the PGP signature of the commit.
37
+ PGPSignature string
38
38
// Message is the commit message, contains arbitrary text.
39
39
Message string
40
40
// TreeHash is the hash of the root tree of the commit.
@@ -152,30 +152,30 @@ func (c *Commit) Decode(o plumbing.EncodedObject) (err error) {
152
152
r := bufio .NewReader (reader )
153
153
154
154
var message bool
155
- var gpgsig bool
155
+ var pgpsig bool
156
156
for {
157
157
line , err := r .ReadBytes ('\n' )
158
158
if err != nil && err != io .EOF {
159
159
return err
160
160
}
161
161
162
- if gpgsig {
162
+ if pgpsig {
163
163
// Check if it's the end of a PGP signature.
164
164
if bytes .Contains (line , []byte (endpgp )) {
165
- c .GPGSignature += string ( endpgp ) + "\n "
166
- gpgsig = false
165
+ c .PGPSignature += endpgp + "\n "
166
+ pgpsig = false
167
167
} else {
168
168
// Trim the left padding.
169
169
line = bytes .TrimLeft (line , " " )
170
- c .GPGSignature += string (line )
170
+ c .PGPSignature += string (line )
171
171
}
172
172
continue
173
173
}
174
174
175
175
// Check if it's the beginning of a PGP signature.
176
176
if bytes .Contains (line , []byte (beginpgp )) {
177
- c .GPGSignature += string ( beginpgp ) + "\n "
178
- gpgsig = true
177
+ c .PGPSignature += beginpgp + "\n "
178
+ pgpsig = true
179
179
continue
180
180
}
181
181
@@ -243,14 +243,14 @@ func (b *Commit) Encode(o plumbing.EncodedObject) error {
243
243
return err
244
244
}
245
245
246
- if b .GPGSignature != "" {
247
- if _ , err = fmt .Fprint (w , "gpgsig " ); err != nil {
246
+ if b .PGPSignature != "" {
247
+ if _ , err = fmt .Fprint (w , "pgpsig " ); err != nil {
248
248
return err
249
249
}
250
250
251
251
// Split all the signature lines and write with a left padding and
252
252
// newline at the end.
253
- lines := strings .Split (b .GPGSignature , "\n " )
253
+ lines := strings .Split (b .PGPSignature , "\n " )
254
254
for _ , line := range lines {
255
255
if _ , err = fmt .Fprintf (w , " %s\n " , line ); err != nil {
256
256
return err
0 commit comments