diff options
author | Hordur Freyr Yngvason <hfyngvason@gitlab.com> | 2019-08-15 23:20:08 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2019-08-15 23:20:08 +0300 |
commit | d3c5ff7b723b9447e2b672fb844bb42dde687ac9 (patch) | |
tree | d2ab2578b099bed0363bed3f2dbec7b7155c01cd /lib/gitlab/project_template.rb | |
parent | 44717d26847384fb6cb82e3ce54e831b37bdf1bc (diff) |
Squash project templates on update
As per https://gitlab.com/gitlab-org/gitlab-ce/issues/46043, project
templates should be squashed before updating, so that repositories
created from these templates don't include the full history of the
backing repository.
Diffstat (limited to 'lib/gitlab/project_template.rb')
-rw-r--r-- | lib/gitlab/project_template.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/project_template.rb b/lib/gitlab/project_template.rb index dbf469a44c1..fa1d1203842 100644 --- a/lib/gitlab/project_template.rb +++ b/lib/gitlab/project_template.rb @@ -24,6 +24,14 @@ module Gitlab "#{preview}.git" end + def project_path + URI.parse(preview).path.sub(%r{\A/}, '') + end + + def uri_encoded_project_path + ERB::Util.url_encode(project_path) + end + def ==(other) name == other.name && title == other.title end |