2013-06-23 12:47:22 -04:00
|
|
|
class Projects::RepositoriesController < Projects::ApplicationController
|
2011-12-30 15:56:13 -05:00
|
|
|
# Authorize
|
2015-04-16 08:03:37 -04:00
|
|
|
before_action :require_non_empty_project, except: :create
|
|
|
|
before_action :authorize_download_code!
|
|
|
|
before_action :authorize_admin_project!, only: :create
|
2014-11-29 17:50:25 -05:00
|
|
|
|
|
|
|
def create
|
|
|
|
@project.create_repository
|
|
|
|
|
2015-02-25 22:34:16 -05:00
|
|
|
redirect_to project_path(@project)
|
2014-11-29 17:50:25 -05:00
|
|
|
end
|
2011-12-30 15:56:13 -05:00
|
|
|
|
2012-02-07 18:00:49 -05:00
|
|
|
def archive
|
2016-06-06 07:16:30 -04:00
|
|
|
send_git_archive @repository, ref: params[:ref], format: params[:format]
|
2015-10-08 11:12:00 -04:00
|
|
|
rescue => ex
|
|
|
|
logger.error("#{self.class.name}: #{ex}")
|
|
|
|
return git_not_found!
|
2012-02-07 18:00:49 -05:00
|
|
|
end
|
2011-12-30 15:56:13 -05:00
|
|
|
end
|