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:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-16 16:33:11 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2016-06-20 22:48:28 +0300
commit483dc62eaac0e11717b5b103317c4441ec0ff23d (patch)
tree40b5954f0f5f0f181d3fa73ec36cd1492d2e0669 /lib/api/templates.rb
parent96ae6099dd5921ae32139a206d598043520fb506 (diff)
Incorporate review
Diffstat (limited to 'lib/api/templates.rb')
-rw-r--r--lib/api/templates.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/templates.rb b/lib/api/templates.rb
index 9f5f10a5088..33cbb0c9e1b 100644
--- a/lib/api/templates.rb
+++ b/lib/api/templates.rb
@@ -2,7 +2,7 @@ module API
class Templates < Grape::API
TEMPLATE_TYPES = {
gitignores: Gitlab::Template::Gitignore,
- gitlab_ci_ymls: Gitlab::Template::GitlabCIYml
+ gitlab_ci_ymls: Gitlab::Template::GitlabCiYml
}.freeze
TEMPLATE_TYPES.each do |template, klass|
@@ -29,6 +29,10 @@ module API
new_template = klass.find(params[:name])
not_found!("#{template.to_s.singularize}") unless new_template
+ if new_template.class == Gitlab::Template::GitlabCiYml
+ new_template.content = "# This file is a template, and might need editing before it works on your project.\n" + new_template.content
+ end
+
present new_template, with: Entities::Template
end
end