We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04017f2 commit 7d46134Copy full SHA for 7d46134
services/asymkey/sign.go
@@ -290,16 +290,22 @@ Loop:
290
return false, nil, nil, err
291
}
292
defer gitRepo.Close()
293
- commit, err := gitRepo.GetCommit(parentCommit)
+ isEmpty, err := gitRepo.IsEmpty()
294
if err != nil {
295
296
297
- if commit.Signature == nil {
298
- return false, nil, nil, &ErrWontSign{parentSigned}
299
- }
300
- verification := ParseCommitWithSignature(ctx, commit)
301
- if !verification.Verified {
302
+ if !isEmpty {
+ commit, err := gitRepo.GetCommit(parentCommit)
+ if err != nil {
+ return false, nil, nil, err
+ }
+ if commit.Signature == nil {
303
+ return false, nil, nil, &ErrWontSign{parentSigned}
304
305
+ verification := ParseCommitWithSignature(ctx, commit)
306
+ if !verification.Verified {
307
308
309
310
311
0 commit comments