Method: Git::Base#repo_size

Defined in:
lib/git/base.rb

#repo_size

returns the repository size in bytes

[View source]

259
260
261
262
263
264
265
266
267
# File 'lib/git/base.rb', line 259

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