diff options
author | Stan Hu <stanhu@gmail.com> | 2017-05-29 00:18:18 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-05-29 16:16:47 +0300 |
commit | 59b8165c9091751ebbae271655fd0eaf3c97ab20 (patch) | |
tree | 2cf54ec2d596715ca8d73dd84549ad7f85950173 /app | |
parent | 8a9e2415ca92897f2920127b7c1986a7c33d2035 (diff) |
Strip trailing whitespaces in submodule URLs
Users attempting to access repositories that had `.gitmodules` entries
with trailing whitespaces would encounter an Error 500. This was due
to a change in bf876ec7 that quietly removed the whitespace stripping.
Closes #33018
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/submodule_helper.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/helpers/submodule_helper.rb b/app/helpers/submodule_helper.rb index 09b73eee8cf..c0763a8a9c4 100644 --- a/app/helpers/submodule_helper.rb +++ b/app/helpers/submodule_helper.rb @@ -13,6 +13,7 @@ module SubmoduleHelper if url =~ /([^\/:]+)\/([^\/]+(?:\.git)?)\Z/ namespace, project = $1, $2 + project.rstrip! project.sub!(/\.git\z/, '') if self_url?(url, namespace, project) |