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 'lib/gitlab/ci/config/external/file/local.rb')
-rw-r--r--lib/gitlab/ci/config/external/file/local.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab/ci/config/external/file/local.rb b/lib/gitlab/ci/config/external/file/local.rb
index 36fc5c656fc..0912a732158 100644
--- a/lib/gitlab/ci/config/external/file/local.rb
+++ b/lib/gitlab/ci/config/external/file/local.rb
@@ -31,10 +31,14 @@ module Gitlab
private
+ def validate_context!
+ return if context.project&.repository
+
+ errors.push("Local file `#{masked_location}` does not have project!")
+ end
+
def validate_content!
- if context.project&.repository.nil?
- errors.push("Local file `#{masked_location}` does not have project!")
- elsif content.nil?
+ if content.nil?
errors.push("Local file `#{masked_location}` does not exist!")
elsif content.blank?
errors.push("Local file `#{masked_location}` is empty!")