diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-06-22 11:31:27 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-06-22 11:53:18 +0200 |
commit | 4e9491f7bb8e22e313f9366a3e46ccba55822d65 (patch) | |
tree | 0d1fb7cd12fc1fcf54d0b529d8955997e4e92b15 /lib | |
parent | b487a798007927ae06fb792d4aa287c4bbf4498c (diff) | |
download | gitlab-ce-4e9491f7bb8e22e313f9366a3e46ccba55822d65.tar.gz |
Repository size is Gitaly onlyzj-repository-size
Closes https://gitlab.com/gitlab-org/gitaly/issues/393
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/repository.rb | 16 |
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/`. |