files_controller.rb revision cffc92f13f7dabf3958b39ace4edec5b41001b78
case @info[:type]
end
else
end
end
end
end
end
def history
@per_page = 25
if repository.empty?
@commits = []
else
end
end
end
if build_file.valid?
else
end
end
end
end
dir = []
dir << part
end
end
dir.join('/')
end
def build_file
args = params[:upload_file].merge({repository: repository}) unless params[:upload_file].nil?
@file ||= UploadFile.new(args)
end
def check_permissions
authorize! :write, repository
end
def send_download(path, oid)
render text: repository.read_file(path, oid)[:content],
content_type: Mime::Type.lookup('application/force-download')
end
def commit_id
@commit_id ||= repository.commit_id(params[:ref])
end
def oid
@oid ||= commit_id[:oid]
end
def branch_name
commit_id[:branch_name]
end
def path
params[:path]
end
end