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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 21:09:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 21:09:00 +0300
commiteb1f5a3e087b7d6a3e85f2724b5a475cc9d9d37d (patch)
treed572a6d931152ae0dd10427237f5811893438552 /lib/gitlab/diff
parentb304a72312465ed4c0a568ee6a6ea5e97f705c9b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/diff_refs.rb2
-rw-r--r--lib/gitlab/diff/formatters/image_formatter.rb2
-rw-r--r--lib/gitlab/diff/formatters/text_formatter.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/diff/diff_refs.rb b/lib/gitlab/diff/diff_refs.rb
index dc245377ccc..12b93af3f26 100644
--- a/lib/gitlab/diff/diff_refs.rb
+++ b/lib/gitlab/diff/diff_refs.rb
@@ -37,7 +37,7 @@ module Gitlab
# We have `base_sha` directly available on `DiffRefs` because it's faster#
# than having to look it up in the repo every time.
def complete?
- start_sha && head_sha
+ start_sha.present? && head_sha.present?
end
def compare_in(project)
diff --git a/lib/gitlab/diff/formatters/image_formatter.rb b/lib/gitlab/diff/formatters/image_formatter.rb
index 90cd74c84bb..d0c13dee1aa 100644
--- a/lib/gitlab/diff/formatters/image_formatter.rb
+++ b/lib/gitlab/diff/formatters/image_formatter.rb
@@ -23,7 +23,7 @@ module Gitlab
end
def complete?
- x && y && width && height
+ [x, y, width, height].all?(&:present?)
end
def to_h
diff --git a/lib/gitlab/diff/formatters/text_formatter.rb b/lib/gitlab/diff/formatters/text_formatter.rb
index f6e247ef665..5b670b1f83b 100644
--- a/lib/gitlab/diff/formatters/text_formatter.rb
+++ b/lib/gitlab/diff/formatters/text_formatter.rb
@@ -19,7 +19,7 @@ module Gitlab
end
def complete?
- old_line || new_line
+ old_line.present? || new_line.present?
end
def to_h