summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2017-11-08 12:59:48 +0000
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-11-09 13:44:20 +0000
commitebd51744729cb1b68754f8ba4d7f9adcec28d58d (patch)
treeff5cc2755ec46060dc83316c484471a3c61cd9f8 /app/models/project.rb
parent78ea074f42543ef352d497f84dba69c6955d843f (diff)
downloadgitlab-ce-ebd51744729cb1b68754f8ba4d7f9adcec28d58d.tar.gz
Handle forks in Gitlab::Checks::LfsIntegrityjej/fix-lfs-integrity-with-forks
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 3a300a4a03c..89db5b1300e 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1042,6 +1042,18 @@ class Project < ActiveRecord::Base
forked_from_project || fork_network&.root_project
end
+ def lfs_storage_project
+ @lfs_storage_project ||= begin
+ result = self
+
+ # TODO: Make this go to the fork_network root immeadiatly
+ # dependant on the discussion in: https://gitlab.com/gitlab-org/gitlab-ce/issues/39769
+ result = result.fork_source while result&.forked?
+
+ result || self
+ end
+ end
+
def personal?
!group
end