Welcome to mirror list, hosted at ThFree Co, Russian Federation.

destroy_rollback_service.rb « repositories « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5ef4e11bf5562187fd92aeb458c5da19adb1af35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class Repositories::DestroyRollbackService < Repositories::BaseService
  def execute
    # There is a possibility project does not have repository or wiki
    return success unless repo_exists?(removal_path)

    # Flush the cache for both repositories.
    ignore_git_errors { repository.before_delete }

    if mv_repository(removal_path, disk_path)
      log_info(%Q{Repository "#{removal_path}" moved to "#{disk_path}" for repository "#{full_path}"})

      success
    else
      move_error(removal_path)
    end
  end
end