Merge pull request #701 from warpc/700-fix_fork
[refs #700] Fix fork error for new project: missing code in child projects. Add recovery task for old project.
This commit is contained in:
commit
a5012519a9
|
@ -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