diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 03:09:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 03:09:12 +0300 |
commit | 6168721025dd8e98caeb2bf6844273e6690eaf69 (patch) | |
tree | 8c4fb20d793669e488a739bc9951dab8b363eed4 /app/services | |
parent | a89cb5cbdd832d4d9e80517973aceda6bc0a3856 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/git/branch_hooks_service.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/services/git/branch_hooks_service.rb b/app/services/git/branch_hooks_service.rb index 69f1f9eb31f..e1cc1f8c834 100644 --- a/app/services/git/branch_hooks_service.rb +++ b/app/services/git/branch_hooks_service.rb @@ -6,7 +6,7 @@ module Git execute_branch_hooks super.tap do - enqueue_update_gpg_signatures + enqueue_update_signatures end end @@ -103,14 +103,22 @@ module Git end end - def enqueue_update_gpg_signatures - unsigned = GpgSignature.unsigned_commit_shas(limited_commits.map(&:sha)) + def unsigned_x509_shas(commits) + X509CommitSignature.unsigned_commit_shas(commits.map(&:sha)) + end + + def unsigned_gpg_shas(commits) + GpgSignature.unsigned_commit_shas(commits.map(&:sha)) + end + + def enqueue_update_signatures + unsigned = unsigned_x509_shas(commits) & unsigned_gpg_shas(commits) return if unsigned.empty? signable = Gitlab::Git::Commit.shas_with_signatures(project.repository, unsigned) return if signable.empty? - CreateGpgSignatureWorker.perform_async(signable, project.id) + CreateCommitSignatureWorker.perform_async(signable, project.id) end # It's not sufficient to just check for a blank SHA as it's possible for the |