Commit bf8b8741 authored by Valery Sizov's avatar Valery Sizov

fix system silent call

parent d1b489e0
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
# Returns true for a valid reference name, false otherwise # Returns true for a valid reference name, false otherwise
def validate(ref_name) def validate(ref_name)
Gitlab::Utils.system_silent( Gitlab::Utils.system_silent(
%W(git check-ref-format refs/#{ref_name})) == 0 %W(git check-ref-format refs/#{ref_name}))
end end
end end
end end
...@@ -5,10 +5,9 @@ module Gitlab ...@@ -5,10 +5,9 @@ module Gitlab
# Run system command without outputting to stdout. # Run system command without outputting to stdout.
# #
# @param cmd [Array<String>] # @param cmd [Array<String>]
# @return [Integer] exit status # @return [Boolean]
def system_silent(cmd) def system_silent(cmd)
IO.popen(cmd).close Popen::popen(cmd).last.zero?
$?.exitstatus
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment