From 585642d072d82a061d4155f0f3aa640f2754bd6d Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 21 Jan 2015 12:04:24 +0000 Subject: [PATCH] scm: git: simplify nil check (#18923) 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index 4980b4138..7395bc2b9 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -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| -- 2.39.5