Commit fac50387 authored by Riyad Preukschas's avatar Riyad Preukschas

Port changes from #2803

parent 42dd006d
...@@ -782,6 +782,9 @@ namespace :gitlab do ...@@ -782,6 +782,9 @@ namespace :gitlab do
Project.find_each(batch_size: 100) do |project| Project.find_each(batch_size: 100) do |project|
print "#{project.name_with_namespace.yellow} ... " print "#{project.name_with_namespace.yellow} ... "
if project.empty_repo?
puts "repository is empty".magenta
else
correct_options = options.map do |name, value| correct_options = options.map do |name, value|
run("git --git-dir=\"#{project.repository.path_to_repo}\" config --get #{name}").try(:chomp) == value run("git --git-dir=\"#{project.repository.path_to_repo}\" config --get #{name}").try(:chomp) == value
end end
...@@ -800,6 +803,7 @@ namespace :gitlab do ...@@ -800,6 +803,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: ... "
...@@ -822,6 +826,10 @@ namespace :gitlab do ...@@ -822,6 +826,10 @@ namespace :gitlab do
Project.find_each(batch_size: 100) do |project| Project.find_each(batch_size: 100) do |project|
print "#{project.name_with_namespace.yellow} ... " 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) project_hook_file = File.join(project.repository.path_to_repo, "hooks", hook_file)
unless File.exists?(project_hook_file) unless File.exists?(project_hook_file)
...@@ -851,6 +859,7 @@ namespace :gitlab do ...@@ -851,6 +859,7 @@ namespace :gitlab do
end end
end end
end end
end
# Helper methods # Helper methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment