summaryrefslogtreecommitdiff
path: root/app/controllers/projects/blob_controller.rb
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-07-01 17:46:37 +0100
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-07-12 15:22:54 +0100
commitac30c60ad9379187e41629ac56c96bd02df6996e (patch)
tree34278f2eaab90e9a2f4f67dc81d2d1be0104a2da /app/controllers/projects/blob_controller.rb
parentb34310ae9e9d3d4331b38f1acf4a51e2247b76ac (diff)
downloadgitlab-ce-ac30c60ad9379187e41629ac56c96bd02df6996e.tar.gz
successfully adds the new version with the updated name on the projects repo
Diffstat (limited to 'app/controllers/projects/blob_controller.rb')
-rw-r--r--app/controllers/projects/blob_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index bcd436f2429..116f184c240 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -44,7 +44,11 @@ class Projects::BlobController < Projects::ApplicationController
"#file-path-#{hexdigest(@path)}"
else
# params[:file_name] stores the new name for the file
- namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, params[:file_name]))
+ unless params[:file_name] == @path
+ @path = params[:file_name]
+ end
+
+ namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @path))
end
create_commit(Files::UpdateService, success_path: after_edit_path,