summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-22 11:31:17 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-22 11:31:17 +0000
commitfb77bc49ae7e9129e8c6e376c92f8e2ed368b1d4 (patch)
tree79b15d4bdf34f966ab840d24694cd5335e5084fb
parentabe627bb9c2e1fead5cbdffa3c39d124f75b302e (diff)
downloadredmine-fb77bc49ae7e9129e8c6e376c92f8e2ed368b1d4.tar.gz
redmine-fb77bc49ae7e9129e8c6e376c92f8e2ed368b1d4.zip
code cleanup: rubocop: fix Style/MultipleComparison in lib/redmine/scm/adapters/git_adapter.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18798 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--.rubocop_todo.yml1
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb10
2 files changed, 5 insertions, 6 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 8018e34cd..38618a59f 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1088,7 +1088,6 @@ Style/MultipleComparison:
- 'app/models/version.rb'
- 'app/models/wiki_page.rb'
- 'app/models/workflow_transition.rb'
- - 'lib/redmine/scm/adapters/git_adapter.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index ee02e5146..ddb1055f3 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -235,7 +235,7 @@ module Redmine
key = "commit"
value = $1
parents_str = $2
- if (parsing_descr == 1 || parsing_descr == 2)
+ if [1, 2].include?(parsing_descr)
parsing_descr = 0
revision = Revision.new({
:identifier => changeset[:commit],
@@ -269,15 +269,15 @@ module Redmine
elsif (parsing_descr == 0) && line.chomp.to_s == ""
parsing_descr = 1
changeset[:description] = +""
- elsif (parsing_descr == 1 || parsing_descr == 2) \
- && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/
+ elsif [1, 2].include?(parsing_descr) &&
+ line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/
parsing_descr = 2
fileaction = $1
filepath = $2
p = scm_iconv('UTF-8', @path_encoding, filepath)
files << {:action => fileaction, :path => p}
- elsif (parsing_descr == 1 || parsing_descr == 2) \
- && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\d+\s+(\S+)\t(.+)$/
+ elsif [1, 2].include?(parsing_descr) &&
+ line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\d+\s+(\S+)\t(.+)$/
parsing_descr = 2
fileaction = $1
filepath = $3