diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/models/deployment.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r-- | app/models/deployment.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb index 20841bc14cd..ea92b978d3a 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -306,8 +306,8 @@ class Deployment < ApplicationRecord last_deployment_id = environment.last_deployment&.id return false unless last_deployment_id.present? - return false if self.id == last_deployment_id + return false if self.sha == environment.last_deployment&.sha self.id < last_deployment_id end @@ -439,8 +439,9 @@ class Deployment < ApplicationRecord end # default tag limit is 100, 0 means no limit + # when refs_by_oid is passed an SHA, returns refs for that commit def tags(limit: 100) - project.repository.tag_names_contains(sha, limit: limit) + project.repository.refs_by_oid(oid: sha, limit: limit, ref_patterns: [Gitlab::Git::TAG_REF_PREFIX]) || [] end strong_memoize_attr :tags |