repositories_controller.rb 526 Bytes
Newer Older
1
class Projects::RepositoriesController < Projects::ApplicationController
2
  # Authorize
3 4 5
  before_action :require_non_empty_project, except: :create
  before_action :authorize_download_code!
  before_action :authorize_admin_project!, only: :create
6 7 8 9

  def create
    @project.create_repository

10
    redirect_to project_path(@project)
11
  end
12

13
  def archive
14
    send_git_archive @repository, ref: params[:ref], format: params[:format]
15 16 17
  rescue => ex
    logger.error("#{self.class.name}: #{ex}")
    return git_not_found!
18
  end
19
end