Переглянути джерело

Ensure default gpg settings not nil and found commits have reference to repo (#8604)

* Ensure defaultGPGSettings not nil

* Ensure that coerced commits gain a reference to the repo

* Add warning if trying to get defaultgpgsetting on an unattached commit
tags/v1.11.0-rc1
zeripath 4 роки тому
джерело
коміт
28f60bb5cb
Аккаунт користувача з таким Email не знайдено
2 змінених файлів з 3 додано та 0 видалено
  1. 2
    0
      models/gpg_key.go
  2. 1
    0
      modules/git/commit_info.go

+ 2
- 0
models/gpg_key.go Переглянути файл

@@ -682,6 +682,8 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
defaultGPGSettings, err := c.GetRepositoryDefaultPublicGPGKey(false)
if err != nil {
log.Error("Error getting default public gpg key: %v", err)
} else if defaultGPGSettings == nil {
log.Warn("Unable to get defaultGPGSettings for unattached commit: %s", c.ID.String())
} else if defaultGPGSettings.Sign {
if commitVerification := verifyWithGPGSettings(defaultGPGSettings, sig, c.Signature.Payload, committer, keyID); commitVerification != nil {
if commitVerification.Reason == BadSignature {

+ 1
- 0
modules/git/commit_info.go Переглянути файл

@@ -72,6 +72,7 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string, cache LastCom
treeCommit = commit
} else if rev, ok := revs[""]; ok {
treeCommit = convertCommit(rev)
treeCommit.repo = commit.repo
}
return commitsInfo, treeCommit, nil
}

Завантаження…
Відмінити
Зберегти