1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-07 16:11:30 +00:00

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
This commit is contained in:
Toshi MARUYAMA 2015-01-21 12:04:24 +00:00
parent 693badf5ff
commit 585642d072

View 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|