summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-23 14:27:09 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-23 14:27:09 +0000
commit68b4701a65d98c16d9f617679f2d3e1bdb37ce99 (patch)
tree5dc99d8352a04461d09a97b1be9dee6686d1fed0
parentdf7188a2e5f04fa241577d91ab986fb927b6155b (diff)
downloadredmine-68b4701a65d98c16d9f617679f2d3e1bdb37ce99.tar.gz
redmine-68b4701a65d98c16d9f617679f2d3e1bdb37ce99.zip
cleanup: rubocop: fix Style/MultilineIfModifier and Style/MultilineTernaryOperator in lib/redmine/scm/adapters/git_adapter.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19199 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--.rubocop_todo.yml2
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb25
2 files changed, 18 insertions, 9 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 1252e78fb..7f5f124aa 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1258,7 +1258,6 @@ Style/MultilineIfModifier:
- 'app/views/common/feed.atom.builder'
- 'lib/redmine/access_keys.rb'
- 'lib/redmine/helpers/gantt.rb'
- - 'lib/redmine/scm/adapters/git_adapter.rb'
- 'lib/redmine/wiki_formatting.rb'
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
- 'test/mocks/open_id_authentication_mock.rb'
@@ -1270,7 +1269,6 @@ Style/MultilineTernaryOperator:
- 'app/models/issue_query.rb'
- 'lib/redmine/ciphering.rb'
- 'lib/redmine/scm/adapters/filesystem_adapter.rb'
- - 'lib/redmine/scm/adapters/git_adapter.rb'
Style/MultipleComparison:
Exclude:
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index d06639726..e469465ab 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -149,13 +149,24 @@ module Redmine
full_path = p.empty? ? name : "#{p}/#{name}"
n = scm_iconv('UTF-8', @path_encoding, name)
full_p = scm_iconv('UTF-8', @path_encoding, full_path)
- entries << Entry.new({:name => n,
- :path => full_p,
- :kind => (type == "tree") ? 'dir' : 'file',
- :size => (type == "tree") ? nil : size,
- :lastrev => options[:report_last_commit] ?
- lastrev(full_path, identifier) : Revision.new
- }) unless entries.detect{|entry| entry.name == name}
+ unless entries.detect{|entry| entry.name == name}
+ entries <<
+ Entry.
+ new(
+ {
+ :name => n,
+ :path => full_p,
+ :kind => (type == "tree") ? 'dir' : 'file',
+ :size => (type == "tree") ? nil : size,
+ :lastrev =>
+ if options[:report_last_commit]
+ lastrev(full_path, identifier)
+ else
+ Revision.new
+ end
+ }
+ )
+ end
end
end
end