summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-07-06 13:51:28 +0100
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-07-08 13:20:05 +0100
commit43c5e1a509389a6a51316b5ed3458f14ae480c57 (patch)
treed604177a6cb146cae2020b10c561bb278e01600d
parentc84786c530dc46111ffc235e4e144975092352b7 (diff)
downloadgitlab-ce-43c5e1a509389a6a51316b5ed3458f14ae480c57.tar.gz
fixes issues for mr acceptance
-rw-r--r--app/models/repository.rb2
-rw-r--r--app/views/projects/blob/_editor.html.haml6
2 files changed, 3 insertions, 5 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index d9c5ec817a0..39264726c9c 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -750,7 +750,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 3c64b2f5e96..31bd4646d3d 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