Check if project.repository before check

Fix for #2776
This commit is contained in:
Donny Kurnia 2013-01-28 21:53:41 +07:00
parent d14069e333
commit 59d91729c8

View file

@ -778,6 +778,7 @@ namespace :gitlab do
} }
Project.find_each(batch_size: 100) do |project| Project.find_each(batch_size: 100) do |project|
if project.repository
print "#{project.name_with_namespace.yellow} ... " print "#{project.name_with_namespace.yellow} ... "
correct_options = options.map do |name, value| correct_options = options.map do |name, value|
@ -798,6 +799,7 @@ namespace :gitlab do
end end
end end
end end
end
def check_repos_post_receive_hooks_is_link def check_repos_post_receive_hooks_is_link
print "post-receive hooks in repos are links: ... " print "post-receive hooks in repos are links: ... "
@ -819,6 +821,7 @@ namespace :gitlab do
puts "" puts ""
Project.find_each(batch_size: 100) do |project| Project.find_each(batch_size: 100) do |project|
if project.repository
print "#{project.name_with_namespace.yellow} ... " print "#{project.name_with_namespace.yellow} ... "
project_hook_file = File.join(project.repository.path_to_repo, "hooks", hook_file) project_hook_file = File.join(project.repository.path_to_repo, "hooks", hook_file)
@ -849,6 +852,7 @@ namespace :gitlab do
end end
end end
end end
end
# Helper methods # Helper methods