diff options
author | Stan Hu <stanhu@gmail.com> | 2017-05-28 14:18:18 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-05-29 06:16:47 -0700 |
commit | 59b8165c9091751ebbae271655fd0eaf3c97ab20 (patch) | |
tree | 2cf54ec2d596715ca8d73dd84549ad7f85950173 /spec/helpers/submodule_helper_spec.rb | |
parent | 8a9e2415ca92897f2920127b7c1986a7c33d2035 (diff) | |
download | gitlab-ce-59b8165c9091751ebbae271655fd0eaf3c97ab20.tar.gz |
Strip trailing whitespaces in submodule URLssh-fix-submodules-trailing-spaces
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 'spec/helpers/submodule_helper_spec.rb')
-rw-r--r-- | spec/helpers/submodule_helper_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/helpers/submodule_helper_spec.rb b/spec/helpers/submodule_helper_spec.rb index 18935be95c9..b05ae5c2232 100644 --- a/spec/helpers/submodule_helper_spec.rb +++ b/spec/helpers/submodule_helper_spec.rb @@ -115,6 +115,11 @@ describe SubmoduleHelper do expect(submodule_links(submodule_item)).to eq(['https://gitlab.com/gitlab-org/gitlab-ce', 'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash']) end + it 'handles urls with trailing whitespace' do + stub_url('http://gitlab.com/gitlab-org/gitlab-ce.git ') + expect(submodule_links(submodule_item)).to eq(['https://gitlab.com/gitlab-org/gitlab-ce', 'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash']) + end + it 'returns original with non-standard url' do stub_url('http://gitlab.com/another/gitlab-org/gitlab-ce.git') expect(submodule_links(submodule_item)).to eq([repo.submodule_url_for, nil]) |