diff --git a/bin/calc_sha b/bin/calc_sha index d647d1523..43b4c3fff 100755 --- a/bin/calc_sha +++ b/bin/calc_sha @@ -1,5 +1,5 @@ #!/bin/bash pwd=`pwd` cd $1 -git filter-branch --tree-filter "$pwd/bin/file-store $2" --prune-empty --tag-name-filter cat -- --all +git filter-branch --tree-filter "$pwd/bin/file-store.rb $2" --prune-empty --tag-name-filter cat -- --all cd .. diff --git a/lib/tasks/shrink_git_repo.rake b/lib/tasks/shrink_git_repo.rake index 9518dd8b7..206ab85ff 100644 --- a/lib/tasks/shrink_git_repo.rake +++ b/lib/tasks/shrink_git_repo.rake @@ -1,8 +1,9 @@ namespace :project do desc "Truncate blobs from git repo" task :remove_archives => :environment do - raise 'Need set GIT_PROJECTS_DIR' if ENV['GIT_PROJECTS_DIR'].blank? - raise 'Need special "rosa_system" user' + #raise 'Need set GIT_PROJECTS_DIR' if ENV['GIT_PROJECTS_DIR'].blank? + raise 'Need set CLONE_PATH' if ENV['CLONE_PATH'].blank? + raise 'Need special "rosa_system" user' unless User.where(:uname => 'rosa_system').exists? token = User.find_by_uname('rosa_system').authentication_token abf_existing_log = File.open "#{ENV['CLONE_PATH']}/projects_with_abf_yml.log", 'w' @@ -27,7 +28,7 @@ namespace :project do time = Time.now path = "#{ENV['CLONE_PATH'].chomp('/')}/repos/#{project.name_with_owner}" FileUtils.rm_rf path - project_path = "#{ENV['GIT_PROJECTS_DIR']}/#{project.name_with_owner}/.git" + project_path = project.path#"#{ENV['GIT_PROJECTS_DIR']}/#{project.name_with_owner}/.git" system "git clone --mirror #{project_path} #{path}/.git" archives_exists = false Dir.chdir(path) do