summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-12-14 11:49:35 +0100
committerJames Lopez <james@jameslopez.es>2018-01-04 11:22:43 +0100
commit260935868acfb7c0cb720088d4f8c4c1c1088ddb (patch)
treec36ca5bef8cb9dd079705e59856ad11f29fbf109 /lib
parentac409fb44402622dfd6abb076f7a85df4b27d39d (diff)
downloadgitlab-ce-260935868acfb7c0cb720088d4f8c4c1c1088ddb.tar.gz
add new git fsck rake task and spec
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/gitlab/git.rake10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/git.rake b/lib/tasks/gitlab/git.rake
index cf82134d97e..f3ffff43726 100644
--- a/lib/tasks/gitlab/git.rake
+++ b/lib/tasks/gitlab/git.rake
@@ -30,6 +30,16 @@ namespace :gitlab do
end
end
+ desc 'GitLab | Git | Check all repos integrity'
+ task fsck: :environment do
+ failures = perform_git_cmd(%W(#{Gitlab.config.git.bin_path} fsck --name-objects --no-progress), "Checking integrity")
+ if failures.empty?
+ puts "Done".color(:green)
+ else
+ output_failures(failures)
+ end
+ end
+
def perform_git_cmd(cmd, message)
puts "Starting #{message} on all repositories"