From e03c18b36abc7432f69a9630721aae80c6c3d7c6 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sat, 13 Feb 2016 13:42:28 -0800 Subject: [PATCH] ignore git repos in scrub --- scrub | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scrub b/scrub index dd747f0..ff6c5cf 100755 --- a/scrub +++ b/scrub @@ -22,6 +22,10 @@ class Scrubber @status = :ok end + def git_repo?(path) + File.exist?(File.join(path, '.git')) + end + def scrub(dir = @root_dir) scrub_file = scrub_filename(dir) if File.exist?(File.join(dir, 'noscrub')) @@ -43,7 +47,9 @@ class Scrubber # descend into subdirectories 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 else