diff --git a/app/models/repository.rb b/app/models/repository.rb index 38ef1b2c57b82079cbc88b6ce8db5d63131a9621..ea7355b3c089858c84cec8b495278a2d19d3a8e7 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -760,7 +760,7 @@ class Repository } if options[:previous_path] - commit_options[:file].merge!(previous_path: options[:previous_path]) + commit_options[:file][:previous_path] = options[:previous_path] Gitlab::Git::Blob.rename(raw_repository, commit_options) else diff --git a/app/views/projects/blob/_editor.html.haml b/app/views/projects/blob/_editor.html.haml index 3c64b2f5e96e165cc02aa3464c21baaf13a2e8a3..31bd4646d3dd7d4b91d65cc0360c9550205f65bf 100644 --- a/app/views/projects/blob/_editor.html.haml +++ b/app/views/projects/blob/_editor.html.haml @@ -4,11 +4,9 @@ = icon('code-fork') = ref %span.editor-file-name - - if current_action?(:edit) && can?(current_user, :push_code, @project) - = text_field_tag 'file_name', params[:file_name], placeholder: @path, + -if current_action?(:edit) || current_action?(:update) + = text_field_tag 'file_name', (params[:file_name] or @path), class: 'form-control new-file-name' - - else - = @path - if current_action?(:new) || current_action?(:create) %span.editor-file-name