]> source.dussan.org Git - redmine.git/commitdiff
scm: git: simplify nil check (#18923)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Jan 2015 12:04:24 +0000 (12:04 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Jan 2015 12:04:24 +0000 (12:04 +0000)
On Ruby, "if []" is true

git-svn-id: http://svn.redmine.org/redmine/trunk@13931 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/git_adapter.rb

index 4980b4138924f5eeeb1a66b61cef040674ea674e..7395bc2b9b472dcacf2231528bda470391e1c4a8 100644 (file)
@@ -76,7 +76,7 @@ module Redmine
         end
 
         def branches
-          return @branches if !@branches.nil?
+          return @branches if @branches
           @branches = []
           cmd_args = %w|branch --no-color --verbose --no-abbrev|
           git_cmd(cmd_args) do |io|
@@ -95,7 +95,7 @@ module Redmine
         end
 
         def tags
-          return @tags if !@tags.nil?
+          return @tags if @tags
           @tags = []
           cmd_args = %w|tag|
           git_cmd(cmd_args) do |io|