Remove oldrev and newrev nil-checks that are now unnecessary

This commit is contained in:
Douwe Maan 2018-12-20 17:45:06 +01:00
parent 3a0ae96c0e
commit 48ca2dc6e1
No known key found for this signature in database
GPG Key ID: 5976703F65143D36
2 changed files with 6 additions and 2 deletions

View File

@ -18,12 +18,16 @@ module Gitlab
private
def creation?
Gitlab::Git.blank_ref?(oldrev)
end
def deletion?
Gitlab::Git.blank_ref?(newrev)
end
def update?
!Gitlab::Git.blank_ref?(oldrev) && !deletion?
!creation? && !deletion?
end
def updated_from_web?

View File

@ -11,7 +11,7 @@ module Gitlab
}.freeze
def validate!
return if deletion? || newrev.nil?
return if deletion?
return unless should_run_diff_validations?
return if commits.empty?