2013-11-05 10:21:11 +00:00
|
|
|
class Projects::NewTreeController < Projects::BaseTreeController
|
|
|
|
before_filter :require_branch_head
|
2013-11-05 08:28:49 +00:00
|
|
|
|
|
|
|
def show
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
2013-11-05 10:06:52 +00:00
|
|
|
result = Files::CreateContext.new(@project, current_user, params, @ref, @path).execute
|
2013-11-05 08:28:49 +00:00
|
|
|
|
2013-11-05 10:06:52 +00:00
|
|
|
if result[:status] == :success
|
|
|
|
flash[:notice] = "Your changes have been successfully commited"
|
|
|
|
redirect_to project_blob_path(@project, File.join(@id, params[:file_name]))
|
2013-11-05 08:28:49 +00:00
|
|
|
else
|
2013-11-05 10:06:52 +00:00
|
|
|
flash[:alert] = result[:error]
|
2013-11-05 08:28:49 +00:00
|
|
|
render :show
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|