diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-03 01:07:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-03 01:07:33 +0300 |
commit | 0eb0daa071d5caa34385aba190ba5aece09b1527 (patch) | |
tree | 3e8c447803f0f6456e9ce17956c3727005475fea /lib/extracts_ref.rb | |
parent | f91c598db1bfae546441b87715180b9925a85264 (diff) |
Add latest changes from gitlab-org/security/gitlab@15-11-stable-ee
Diffstat (limited to 'lib/extracts_ref.rb')
-rw-r--r-- | lib/extracts_ref.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/extracts_ref.rb b/lib/extracts_ref.rb index 49c9772f760..5f73b474956 100644 --- a/lib/extracts_ref.rb +++ b/lib/extracts_ref.rb @@ -157,11 +157,11 @@ module ExtractsRef end def ambiguous_ref?(project, ref) + return false unless ref return true if project.repository.ambiguous_ref?(ref) + return false unless ref.starts_with?(%r{(refs|heads|tags)/}) - return false unless ref&.starts_with?('refs/') - - unprefixed_ref = ref.sub(%r{^refs/(heads|tags)/}, '') + unprefixed_ref = ref.sub(%r{^(refs/)?(heads|tags)/}, '') project.repository.commit(unprefixed_ref).present? end end |