Module: API::Helpers::ProjectSnapshotsHelpers

Defined in:
lib/api/helpers/project_snapshots_helpers.rb

Instance Method Summary collapse

Instance Method Details

#authorize_read_git_snapshot!Object


8
9
10
# File 'lib/api/helpers/project_snapshots_helpers.rb', line 8

def authorize_read_git_snapshot!
  authenticated_with_can_read_all_resources!
end

#send_git_snapshot(repository) ⇒ Object


12
13
14
# File 'lib/api/helpers/project_snapshots_helpers.rb', line 12

def send_git_snapshot(repository)
  header(*Gitlab::Workhorse.send_git_snapshot(repository))
end

#snapshot_projectObject


16
17
18
# File 'lib/api/helpers/project_snapshots_helpers.rb', line 16

def snapshot_project
  user_project
end

#snapshot_repositoryObject


20
21
22
23
24
25
26
# File 'lib/api/helpers/project_snapshots_helpers.rb', line 20

def snapshot_repository
  if to_boolean(params[:wiki])
    snapshot_project.wiki.repository
  else
    snapshot_project.repository
  end
end