Merge pull request #725 from warpc/file-store-4_optimize_script

[file-store-4] optimize searching
This commit is contained in:
Vladimir Sharshov 2012-11-16 07:15:25 -08:00
commit 2629516109
1 changed files with 1 additions and 5 deletions

View File

@ -33,12 +33,8 @@ Dir.glob(owners).each do |owner|
system "cd #{path} && git config --bool core.bare false && git checkout -f HEAD" system "cd #{path} && git config --bool core.bare false && git checkout -f HEAD"
#-- #--
Dir.chdir(path) 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" 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 !!! # This is dangerous !!!