summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-10-23 03:57:51 +0300
committerStan Hu <stanhu@gmail.com>2017-10-23 04:15:26 +0300
commit3bff85a4f659438edbbc486a0b3c32ff589ab299 (patch)
tree8132af0cb2f83ffea9b37a8d841cc1e35ae789b7 /app
parent40ded704cc9b535bee9afd45512d52173c3fc0e7 (diff)
downloadgitlab-ce-3bff85a4f659438edbbc486a0b3c32ff589ab299.tar.gz
Fix the writing of invalid environment refssh-fix-environment-write-ref
Environment names that contained a space would cause an error in GitLab 10.1 because a new guard clause was introduced in Repository#write_ref to prevent such references from existing. Use the slug instead to ensure that the name is valid. Closes #39182
Diffstat (limited to 'app')
-rw-r--r--app/models/environment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index b6868ccbe8f..e613d21add6 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -110,7 +110,7 @@ class Environment < ActiveRecord::Base
end
def ref_path
- "refs/#{Repository::REF_ENVIRONMENTS}/#{Shellwords.shellescape(name)}"
+ "refs/#{Repository::REF_ENVIRONMENTS}/#{generate_slug}"
end
def formatted_external_url