Port changes from #2803

This commit is contained in:
Riyad Preukschas 2013-02-01 21:18:09 +01:00
parent 42dd006dfc
commit fac503877d

View file

@ -782,6 +782,9 @@ namespace :gitlab do
Project.find_each(batch_size: 100) do |project|
print "#{project.name_with_namespace.yellow} ... "
if project.empty_repo?
puts "repository is empty".magenta
else
correct_options = options.map do |name, value|
run("git --git-dir=\"#{project.repository.path_to_repo}\" config --get #{name}").try(:chomp) == value
end
@ -800,6 +803,7 @@ namespace :gitlab do
end
end
end
end
def check_repos_post_receive_hooks_is_link
print "post-receive hooks in repos are links: ... "
@ -822,6 +826,10 @@ namespace :gitlab do
Project.find_each(batch_size: 100) do |project|
print "#{project.name_with_namespace.yellow} ... "
if project.empty_repo?
puts "repository is empty".magenta
else
project_hook_file = File.join(project.repository.path_to_repo, "hooks", hook_file)
unless File.exists?(project_hook_file)
@ -851,6 +859,7 @@ namespace :gitlab do
end
end
end
end
# Helper methods