ignore git repos in scrub

This commit is contained in:
Sami Samhuri 2016-02-13 13:42:28 -08:00
parent 810e460a15
commit e03c18b36a

8
scrub
View file

@ -22,6 +22,10 @@ class Scrubber
@status = :ok @status = :ok
end end
def git_repo?(path)
File.exist?(File.join(path, '.git'))
end
def scrub(dir = @root_dir) def scrub(dir = @root_dir)
scrub_file = scrub_filename(dir) scrub_file = scrub_filename(dir)
if File.exist?(File.join(dir, 'noscrub')) if File.exist?(File.join(dir, 'noscrub'))
@ -43,7 +47,9 @@ class Scrubber
# descend into subdirectories # descend into subdirectories
if File.directory?(file) if File.directory?(file)
scrub(file)
# ignore git repos as the contents may change and git can fsck itself
scrub(file) unless git_repo?(file)
# scrub this file # scrub this file
else else