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:
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