fix system silent call

This commit is contained in:
Valery Sizov 2014-11-06 11:47:38 +02:00
parent d1b489e048
commit bf8b874117
2 changed files with 3 additions and 4 deletions

View File

@ -6,7 +6,7 @@ module Gitlab
# Returns true for a valid reference name, false otherwise
def validate(ref_name)
Gitlab::Utils.system_silent(
%W(git check-ref-format refs/#{ref_name})) == 0
%W(git check-ref-format refs/#{ref_name}))
end
end
end

View File

@ -5,10 +5,9 @@ module Gitlab
# Run system command without outputting to stdout.
#
# @param cmd [Array<String>]
# @return [Integer] exit status
# @return [Boolean]
def system_silent(cmd)
IO.popen(cmd).close
$?.exitstatus
Popen::popen(cmd).last.zero?
end
end
end