From 590c2fbb009270812117069186c5efef1eba8732 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 16 Nov 2012 21:05:05 +0600 Subject: [PATCH] [file-store-4] optimize searching --- bin/remove_archives.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/remove_archives.rb b/bin/remove_archives.rb index 1bfa40322..89e98fc61 100755 --- a/bin/remove_archives.rb +++ b/bin/remove_archives.rb @@ -33,12 +33,8 @@ Dir.glob(owners).each do |owner| system "cd #{path} && git config --bool core.bare false && git checkout -f HEAD" #-- Dir.chdir(path) - archives_exists = false - %w(tar.bz2 tar.gz bz2 rar gz tar tbz2 tgz zip Z 7z tar.xz).each do |ext| - archives_exists=true and break unless `git log --all --format='%H' -- *.#{ext}`.empty? - end - if archives_exists + unless `git log --all --format='%H' -- *.{tar\.bz2,tar\.gz,bz2,rar,gz,tar,tbz2,tgz,zip,Z,7z,tar\.xz}`.empty? system "git filter-branch -d /dev/shm/git_task --tree-filter \"/home/rosa/git_task/file-store.rb #{token}\" --prune-empty --tag-name-filter cat -- --all" ##### # This is dangerous !!!