gitlab-org--gitlab-foss/app/controllers/projects/repositories_controller.rb
Jacob Vosmaer cb13980db8 Let gitlab-git-http-server handle archive downloads
This change relies on changes in gitlab_git and gitlab-git-http-server.
2015-10-08 17:12:00 +02:00

19 lines
544 B
Ruby

class Projects::RepositoriesController < Projects::ApplicationController
# Authorize
before_action :require_non_empty_project, except: :create
before_action :authorize_download_code!
before_action :authorize_admin_project!, only: :create
def create
@project.create_repository
redirect_to project_path(@project)
end
def archive
render json: ArchiveRepositoryService.new(@project, params[:ref], params[:format]).execute
rescue => ex
logger.error("#{self.class.name}: #{ex}")
return git_not_found!
end
end