2018-11-19 10:03:58 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Git
|
|
|
|
class RepositoryCleaner
|
|
|
|
include Gitlab::Git::WrapsGitalyErrors
|
|
|
|
|
|
|
|
attr_reader :repository
|
|
|
|
|
|
|
|
# 'repository' is a Gitlab::Git::Repository
|
|
|
|
def initialize(repository)
|
|
|
|
@repository = repository
|
|
|
|
end
|
|
|
|
|
2019-03-25 10:29:51 -04:00
|
|
|
def apply_bfg_object_map_stream(io, &blk)
|
2018-11-19 10:03:58 -05:00
|
|
|
wrapped_gitaly_errors do
|
2019-03-25 10:29:51 -04:00
|
|
|
gitaly_cleanup_client.apply_bfg_object_map_stream(io, &blk)
|
2018-11-19 10:03:58 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def gitaly_cleanup_client
|
|
|
|
@gitaly_cleanup_client ||= Gitlab::GitalyClient::CleanupService.new(repository)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|