diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 00:09:12 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 00:09:12 +0000 |
commit | 6168721025dd8e98caeb2bf6844273e6690eaf69 (patch) | |
tree | 8c4fb20d793669e488a739bc9951dab8b363eed4 /app/services/git | |
parent | a89cb5cbdd832d4d9e80517973aceda6bc0a3856 (diff) | |
download | gitlab-ce-6168721025dd8e98caeb2bf6844273e6690eaf69.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/git')
-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 |