From 3bff85a4f659438edbbc486a0b3c32ff589ab299 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 23 Oct 2017 03:57:51 +0300 Subject: Fix the writing of invalid environment refs 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 --- app/models/environment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/environment.rb') 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 -- cgit v1.2.1