summaryrefslogtreecommitdiff
path: root/lib/banzai/cross_project_reference.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/banzai/cross_project_reference.rb')
-rw-r--r--lib/banzai/cross_project_reference.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/banzai/cross_project_reference.rb b/lib/banzai/cross_project_reference.rb
index b7344808989..1bf6cf11526 100644
--- a/lib/banzai/cross_project_reference.rb
+++ b/lib/banzai/cross_project_reference.rb
@@ -17,7 +17,12 @@ module Banzai
return context[:project] || context[:group] unless ref
return context[:project] if context[:project]&.full_path == ref
- Project.find_by_full_path(ref)
+ if reference_cache.cache_loaded?
+ # optimization to reuse the parent_per_reference query information
+ reference_cache.parent_per_reference[ref || reference_cache.current_parent_path]
+ else
+ Project.find_by_full_path(ref)
+ end
end
end
end