summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-06-22 13:12:50 +0000
committerDouwe Maan <douwe@gitlab.com>2018-06-22 13:12:50 +0000
commit4b8ac87b68974ab48e9cd1695c0a76d4953791b2 (patch)
tree60d00c1cb8a2a584452db2a0d792ffe99540a346
parent19300e7e7cb393caaeaa8d906b312ccc1f3eed26 (diff)
parent4e9491f7bb8e22e313f9366a3e46ccba55822d65 (diff)
downloadgitlab-ce-4b8ac87b68974ab48e9cd1695c0a76d4953791b2.tar.gz
Merge branch 'zj-repository-size' into 'master'
Repository size is Gitaly only Closes gitaly#393 See merge request gitlab-org/gitlab-ce!20089
-rw-r--r--lib/gitlab/git/repository.rb16
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 2b599ee9f82..d79c4107200 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -403,13 +403,7 @@ module Gitlab
# Return repo size in megabytes
def size
- size = gitaly_migrate(:repository_size) do |is_enabled|
- if is_enabled
- size_by_gitaly
- else
- size_by_shelling_out
- end
- end
+ size = gitaly_repository_client.repository_size
(size.to_f / 1024).round(2)
end
@@ -1822,14 +1816,6 @@ module Gitlab
commit(sha)
end
- def size_by_shelling_out
- popen(%w(du -sk), path).first.strip.to_i
- end
-
- def size_by_gitaly
- gitaly_repository_client.repository_size
- end
-
# Returns true if the given ref name exists
#
# Ref names must start with `refs/`.