Commit 47b9854d authored by Douwe Maan's avatar Douwe Maan

Merge branch 'gitaly-fsck-mandatory' into 'master'

Make 'git fsck' mandatory

See merge request gitlab-org/gitlab-ce!17648
parents 7623cae9 3ddde75a
...@@ -1189,16 +1189,10 @@ module Gitlab ...@@ -1189,16 +1189,10 @@ module Gitlab
end end
def fsck def fsck
gitaly_migrate(:git_fsck) do |is_enabled| msg, status = gitaly_repository_client.fsck
msg, status = if is_enabled
gitaly_fsck
else
shell_fsck
end
raise GitError.new("Could not fsck repository: #{msg}") unless status.zero? raise GitError.new("Could not fsck repository: #{msg}") unless status.zero?
end end
end
def create_from_bundle(bundle_path) def create_from_bundle(bundle_path)
gitaly_migrate(:create_repo_from_bundle) do |is_enabled| gitaly_migrate(:create_repo_from_bundle) do |is_enabled|
...@@ -1596,14 +1590,6 @@ module Gitlab ...@@ -1596,14 +1590,6 @@ module Gitlab
File.write(File.join(worktree_info_path, 'sparse-checkout'), files) File.write(File.join(worktree_info_path, 'sparse-checkout'), files)
end end
def gitaly_fsck
gitaly_repository_client.fsck
end
def shell_fsck
run_git(%W[--git-dir=#{path} fsck], nice: true)
end
def rugged_fetch_source_branch(source_repository, source_branch, local_ref) def rugged_fetch_source_branch(source_repository, source_branch, local_ref)
with_repo_branch_commit(source_repository, source_branch) do |commit| with_repo_branch_commit(source_repository, source_branch) do |commit|
if commit if commit
......
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