[refs #700] fix fork && repare task
This commit is contained in:
parent
3413a681af
commit
7ad1a82876
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue