[refs #700] fix fork && repare task

This commit is contained in:
Alexander Machehin 2012-10-18 20:34:32 +06:00
parent 3413a681af
commit 7ad1a82876
2 changed files with 14 additions and 1 deletions

View File

@ -116,7 +116,7 @@ module Modules
end
def fork_git_repo
dummy = Grit::Repo.new(path) rescue parent.repo.fork_bare(path)
dummy = Grit::Repo.new(path) rescue parent.repo.fork_bare(path, :shared => false)
write_hook
end

View File

@ -0,0 +1,13 @@
namespace :project do
desc 'Break the dependency of a repository cloned with --shared on its source repository'
task :git_detach_from_parent => :environment do
projects = Project.where('ancestry IS NOT NULL')
say "Total count of the forked projects is #{projects.count}"
projects.each_with_index do |project, ind|
Dir.chdir(project.path) do
say "--Start work with #{project.name_with_owner} (#{ind+1}/#{projects.count})--"
say (system('git', 'repack', '-a') ? 'Ok!' : 'Something wrong!')
end
end
end
end