Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-03 01:07:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-03 01:07:33 +0300
commit0eb0daa071d5caa34385aba190ba5aece09b1527 (patch)
tree3e8c447803f0f6456e9ce17956c3727005475fea /lib/extracts_ref.rb
parentf91c598db1bfae546441b87715180b9925a85264 (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.rb6
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