summaryrefslogtreecommitdiff
path: root/lib/backup
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-07 12:08:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-07 12:08:05 +0000
commitedb317e9fe43c62229805fae529c550467ee5dc5 (patch)
tree90c590ea021e657b828685ac4459713913928dc9 /lib/backup
parentbdd03bc52aee1c3f37e25ae9b1fc8a27885b7428 (diff)
downloadgitlab-ce-edb317e9fe43c62229805fae529c550467ee5dc5.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/backup')
-rw-r--r--lib/backup/repositories.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/backup/repositories.rb b/lib/backup/repositories.rb
index 82a711add7f..4f4a098f374 100644
--- a/lib/backup/repositories.rb
+++ b/lib/backup/repositories.rb
@@ -72,14 +72,26 @@ module Backup
def project_relation
scope = Project.includes(:route, :group, namespace: :owner)
scope = scope.id_in(ProjectRepository.for_repository_storage(storages).select(:project_id)) if storages.any?
- scope = scope.where_full_path_in(paths) if paths.any?
+ if paths.any?
+ scope = scope.where_full_path_in(paths).or(
+ Project.where(namespace_id: Namespace.where_full_path_in(paths).self_and_descendants)
+ )
+ end
+
scope
end
def snippet_relation
scope = Snippet.all
scope = scope.id_in(SnippetRepository.for_repository_storage(storages).select(:snippet_id)) if storages.any?
- scope = scope.joins(:project).merge(Project.where_full_path_in(paths)) if paths.any?
+ if paths.any?
+ scope = scope.joins(:project).merge(
+ Project.where_full_path_in(paths).or(
+ Project.where(namespace_id: Namespace.where_full_path_in(paths).self_and_descendants)
+ )
+ )
+ end
+
scope
end