Fixed bug with Windows line endings in blob editing.

This commit is contained in:
George Vinogradov 2012-02-24 20:34:41 +04:00
parent 482874409d
commit 586d4e0bea
1 changed files with 2 additions and 2 deletions

View File

@ -29,8 +29,8 @@ class Git::BlobsController < Git::BaseController
# @git_repository.after_update_file do |repo, sha|
# end
res = @git_repository.update_file(params[:path], params[:content],
:message => params[:message], :actor => current_user, :head => @treeish)
res = @git_repository.update_file(params[:path], params[:content].gsub("\r", ''),
:message => params[:message].gsub("\r", ''), :actor => current_user, :head => @treeish)
if res
flash[:notice] = t("flash.blob.successfully_updated", :name => params[:path].encode_to_default)
else