Method: Git::Base#repo_size

Defined in:
lib/git/base.rb

#repo_size

returns the repository size in bytes



232
233
234
235
236
237
238
239
240
# File 'lib/git/base.rb', line 232

def repo_size
  Dir.glob(File.join(repo.path, '**', '*'), File::FNM_DOTMATCH).reject do |f|
    f.include?('..')
  end.map do |f|
    File.expand_path(f)
  end.uniq.map do |f|
    File.stat(f).size.to_i
  end.reduce(:+)
end