Merge branch 'dm-relative-submodule-url-trailing-whitespace' into 'master'
Strip trailing whitespace in relative submodule URL Closes #34347 See merge request !12531
This commit is contained in:
commit
d9432c4752
3 changed files with 10 additions and 0 deletions
|
@ -73,6 +73,7 @@ module SubmoduleHelper
|
|||
end
|
||||
|
||||
def relative_self_links(url, commit)
|
||||
url.rstrip!
|
||||
# Map relative links to a namespace and project
|
||||
# For example:
|
||||
# ../bar.git -> same namespace, repo bar
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Strip trailing whitespace in relative submodule URL
|
||||
merge_request:
|
||||
author:
|
|
@ -170,6 +170,11 @@ describe SubmoduleHelper do
|
|||
expect(result).to eq(["/#{group.path}/test", "/#{group.path}/test/tree/#{commit_id}"])
|
||||
end
|
||||
|
||||
it 'with trailing whitespace' do
|
||||
result = relative_self_links('../test.git ', commit_id)
|
||||
expect(result).to eq(["/#{group.path}/test", "/#{group.path}/test/tree/#{commit_id}"])
|
||||
end
|
||||
|
||||
it 'two levels down' do
|
||||
result = relative_self_links('../../test.git', commit_id)
|
||||
expect(result).to eq(["/#{group.path}/test", "/#{group.path}/test/tree/#{commit_id}"])
|
||||
|
|
Loading…
Reference in a new issue