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>2022-08-11 21:11:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-11 21:11:57 +0300
commit603ee53dbdbd3adaced752e1a119eb40d64e9979 (patch)
tree7c3e912fe4c02ea464063a4a224b02bbcdeea580 /lib/gitlab/object_hierarchy.rb
parentc79523e3952dad31a9ab8ccbb9e38466fec3aec3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/object_hierarchy.rb')
-rw-r--r--lib/gitlab/object_hierarchy.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/object_hierarchy.rb b/lib/gitlab/object_hierarchy.rb
index 9a850246221..0576aed811c 100644
--- a/lib/gitlab/object_hierarchy.rb
+++ b/lib/gitlab/object_hierarchy.rb
@@ -65,7 +65,8 @@ module Gitlab
# Note: By default the order is breadth-first
# rubocop: disable CodeReuse/ActiveRecord
def base_and_ancestors(upto: nil, hierarchy_order: nil)
- cte = base_and_ancestors_cte(upto, hierarchy_order)
+ upto_id = upto.try(:id) || upto
+ cte = base_and_ancestors_cte(upto_id, hierarchy_order)
recursive_query = if hierarchy_order
# othewise depth won't be available for outer query