diff options
author | Douwe Maan <douwe@selenight.nl> | 2018-12-20 19:45:06 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2019-01-02 17:31:33 +0300 |
commit | 48ca2dc6e1bab9aba5baa3412faf66b7ce55b148 (patch) | |
tree | fc9000c1250808c736f83d3a762073cf13ccfbf4 /lib/gitlab/checks | |
parent | 3a0ae96c0e10154c93e5160b4ee239a5d198d282 (diff) |
Remove oldrev and newrev nil-checks that are now unnecessary
Diffstat (limited to 'lib/gitlab/checks')
-rw-r--r-- | lib/gitlab/checks/base_checker.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/checks/diff_check.rb | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/checks/base_checker.rb b/lib/gitlab/checks/base_checker.rb index 7fbcf6a4ff4..09b17b5b76b 100644 --- a/lib/gitlab/checks/base_checker.rb +++ b/lib/gitlab/checks/base_checker.rb @@ -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? diff --git a/lib/gitlab/checks/diff_check.rb b/lib/gitlab/checks/diff_check.rb index 63da9a3d6b5..ea0d8c85a66 100644 --- a/lib/gitlab/checks/diff_check.rb +++ b/lib/gitlab/checks/diff_check.rb @@ -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? |