Commit 985f5c4c authored by Jaime Martinez's avatar Jaime Martinez

Validate commit and branches

parent 8437890a
......@@ -44,10 +44,10 @@ module Gitlab
end
validate do
next unless config[:ref]
next if Commit.reference_valid?(config[:ref])
next if Gitlab::GitRefValidator.validate(config[:ref])
unless Gitlab::GitRefValidator.validate(config[:ref])
errors.add(:ref, "must be a valid ref")
end
errors.add(:ref, "must be a valid ref")
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