Repository size is Gitaly only
Closes https://gitlab.com/gitlab-org/gitaly/issues/393
This commit is contained in:
parent
b487a79800
commit
4e9491f7bb
|
|
@ -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/`.
|
||||
|
|
|
|||
Loading…
Reference in New Issue