diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2015-04-15 22:15:56 -0600 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-17 14:35:42 +0300 |
commit | a7be1ad1431d03d13a92b42b7376e6c9072562bd (patch) | |
tree | a15a47cf8c8b1e9bc1a3fb09ba81507c1b7cc1d5 | |
parent | b6d01abc026f0750db53121619b663867f95ac3d (diff) | |
download | gitlab-ce-a7be1ad1431d03d13a92b42b7376e6c9072562bd.tar.gz |
Add new rake task
Add a task that checks repository integrity with `git fsck`.
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | lib/tasks/gitlab/check.rake | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG index 0487cc64745..ac175b57916 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,7 @@ v 7.10.0 (unreleased) - Don't leak existence of group or project via search. - Fix bug where Wiki pages that included a '/' were no longer accessible (Stan Hu) - Fix bug where error messages from Dropzone would not be displayed on the issues page (Stan Hu) + - Add a rake task to check repository integrity with `git fsck` - Add ability to configure Reply-To address in gitlab.yml (Stan Hu) - Move current user to the top of the list in assignee/author filters (Stan Hu) - Fix broken side-by-side diff view on merge request page (Stan Hu) diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index d791b7155f9..04a2eb12db0 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -687,6 +687,23 @@ namespace :gitlab do end end + namespace :repo do + desc "GITLAB | Check the integrity of the repositories managed by GitLab" + task check: :environment do + namespace_dirs = Dir.glob( + File.join(Gitlab.config.gitlab_shell.repos_path, '*') + ) + + namespace_dirs.each do |namespace_dir| + repo_dirs = Dir.glob(File.join(namespace_dir, '*')) + repo_dirs.each do |dir| + puts "\nChecking repo at #{dir}" + system(*%w(git fsck), chdir: dir) + end + end + end + end + # Helper methods ########################## |