Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
26093586
Commit
26093586
authored
Dec 14, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new git fsck rake task and spec
parent
ac409fb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
lib/tasks/gitlab/git.rake
lib/tasks/gitlab/git.rake
+10
-0
spec/tasks/gitlab/git_rake_spec.rb
spec/tasks/gitlab/git_rake_spec.rb
+27
-0
No files found.
lib/tasks/gitlab/git.rake
View file @
26093586
...
...
@@ -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"
...
...
spec/tasks/gitlab/git_rake_spec.rb
0 → 100644
View file @
26093586
require
'rake_helper'
describe
'gitlab:git rake tasks'
do
before
do
Rake
.
application
.
rake_require
'tasks/gitlab/git'
stub_warn_user_is_not_gitlab
FileUtils
.
mkdir
(
Settings
.
absolute
(
'tmp/tests/default_storage'
))
end
after
do
FileUtils
.
rm_rf
(
Settings
.
absolute
(
'tmp/tests/default_storage'
))
end
describe
'fsck'
do
let
(
:storages
)
do
{
'default'
=>
{
'path'
=>
Settings
.
absolute
(
'tmp/tests/default_storage'
)
}
}
end
it
'outputs the right git command'
do
expect
(
Kernel
).
to
receive
(
:system
).
with
(
''
).
and_return
(
true
)
run_rake_task
(
'gitlab:git:fsck'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment