Browse Source

Skip "parentsigned" check when the repo is empty (#35292)

Fix #35280
pull/35300/head
wxiaoguang 4 months ago committed by GitHub
parent
commit
621f2fcadb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      services/asymkey/sign.go

6
services/asymkey/sign.go

@ -290,6 +290,11 @@ Loop: @@ -290,6 +290,11 @@ Loop:
return false, nil, nil, err
}
defer gitRepo.Close()
isEmpty, err := gitRepo.IsEmpty()
if err != nil {
return false, nil, nil, err
}
if !isEmpty {
commit, err := gitRepo.GetCommit(parentCommit)
if err != nil {
return false, nil, nil, err
@ -303,6 +308,7 @@ Loop: @@ -303,6 +308,7 @@ Loop:
}
}
}
}
return true, signingKey, sig, nil
}

Loading…
Cancel
Save