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
6ee122c0
Commit
6ee122c0
authored
Jan 03, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deprecate check integrity task
parent
5b9e7773
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
39 deletions
+2
-39
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+2
-39
No files found.
lib/tasks/gitlab/check.rake
View file @
6ee122c0
...
...
@@ -387,14 +387,8 @@ namespace :gitlab do
namespace
:repo
do
desc
"GitLab | Check the integrity of the repositories managed by GitLab"
task
check: :environment
do
Gitlab
.
config
.
repositories
.
storages
.
each
do
|
name
,
repository_storage
|
namespace_dirs
=
Dir
.
glob
(
File
.
join
(
repository_storage
[
'path'
],
'*'
))
namespace_dirs
.
each
do
|
namespace_dir
|
repo_dirs
=
Dir
.
glob
(
File
.
join
(
namespace_dir
,
'*'
))
repo_dirs
.
each
{
|
repo_dir
|
check_repo_integrity
(
repo_dir
)
}
end
end
puts
"This task is deprecated. Please use gitlab:git:fsck instead"
.
color
(
:red
)
Rake
::
Task
[
"gitlab:git:fsck"
].
execute
end
end
...
...
@@ -461,35 +455,4 @@ namespace :gitlab do
puts
"FAIL. Please update gitlab-shell to
#{
required_version
}
from
#{
current_version
}
"
.
color
(
:red
)
end
end
def
check_repo_integrity
(
repo_dir
)
puts
"
\n
Checking repo at
#{
repo_dir
.
color
(
:yellow
)
}
"
git_fsck
(
repo_dir
)
check_config_lock
(
repo_dir
)
check_ref_locks
(
repo_dir
)
end
def
git_fsck
(
repo_dir
)
puts
"Running `git fsck`"
.
color
(
:yellow
)
system
(
*
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
fsck)
,
chdir:
repo_dir
)
end
def
check_config_lock
(
repo_dir
)
config_exists
=
File
.
exist?
(
File
.
join
(
repo_dir
,
'config.lock'
))
config_output
=
config_exists
?
'yes'
.
color
(
:red
)
:
'no'
.
color
(
:green
)
puts
"'config.lock' file exists?"
.
color
(
:yellow
)
+
" ...
#{
config_output
}
"
end
def
check_ref_locks
(
repo_dir
)
lock_files
=
Dir
.
glob
(
File
.
join
(
repo_dir
,
'refs/heads/*.lock'
))
if
lock_files
.
present?
puts
"Ref lock files exist:"
.
color
(
:red
)
lock_files
.
each
do
|
lock_file
|
puts
"
#{
lock_file
}
"
end
else
puts
"No ref lock files exist"
.
color
(
:green
)
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