Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/validators/sha_validator.rb')
-rw-r--r--app/validators/sha_validator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/sha_validator.rb b/app/validators/sha_validator.rb
index 77e7cfa4f6b..085fca4d65d 100644
--- a/app/validators/sha_validator.rb
+++ b/app/validators/sha_validator.rb
@@ -2,7 +2,7 @@
class ShaValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
- return if value.blank? || Commit.valid_hash?(value)
+ return if value.blank? || value.match(/\A\h{40}\z/)
record.errors.add(attribute, 'is not a valid SHA')
end